Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My PHP/MySQL code just doesn't want to work...

    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!!

  • #2
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Novosibirsk, Russia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>");

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    WOW!! It worked!!! Thanks a million!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •