...

View Full Version : My PHP/MySQL code just doesn't want to work...



ProAdam
08-10-2002, 05:00 AM
OK, i'm having a huge problem with my pages that display results from a MySQL database. After adding the info to the db, I go to the page to see if the data appears. All I see is a parse error. I asked my buds and they can't find any problems with my script. Can anyone here help me out and tell me what I'm doing wrong? It says parse error on line 100....

<?php
mysql_connect("localhost","Adam","****");
mysql_select_db("thesupercrazysim");
$result = mysql_query("select * from thesims_links");
while($r=mysql_fetch_array($result))
{
$name=$r["name"];
$url=$r["url"];
$webmaster=$r["webmaster"];
$email=$r["email"];
$id=$r["id"];
echo ("<font face="Comic Sans MS" size="3" color="#FFFFFF"><a href="$url">$name</a><br><font face="Comic Sans MS" size="2" color="#FFFFFF"><b>$webmaster<br>$email<font><br>");
}
?>

NOTE: The parse error says line 100. Line 100 is where the echo command starts. Thanks for your help!! :)

Centaur
08-10-2002, 05:54 AM
echo ("<font face="Comic Sans MS" size="3" color="#FFFFFF"><a href="$url">$name</a><br><font face="Comic Sans MS" size="2" color="#FFFFFF"><b>$webmaster<br>$email<font><br>"); Why don&rsquo;t you escape all those " in the string being echoed with a backslash?
echo ("<font face=\"Comic Sans MS\" size=\"3\" color=\"#FFFFFF\"><a href=\"$url\">$name</a><br><font face=\"Comic Sans MS\" size=\"2\" color=\"#FFFFFF\"><b>$webmaster<br>$email<font><br>");

ProAdam
08-10-2002, 06:03 AM
WOW!! It worked!!! Thanks a million!!! :thumbsup: :thumbsup: :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum