SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: newbie problem

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Los Angeles, California
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    newbie problem

    i have just started using PHP and MySQL. I just wrote this script a little while ago but whenever i run it, i get a parse error on line 27. here is the code:
    PHP Code:
    <html>
    <head>
    <title>Links</title>
    </head>
    <body>
    <?php

    // Connect to the database server
    $dbcnx = @mysql_connect("localhost""username""password");
    if (!
    $dbcnx) {
    echo( 
    "<P>Unable to connect to the database server.</P>" );
    exit();
    }

    // Select the database
    if (! @mysql_select_db("database") ) {
    echo( 
    "<P>Unable to locate the database</P> );
    exit();
    }

    ?>
    <P> Links: </P>
    <BLOCKQUOTE>

    <?php
    // Request the text of all the links
    $result = mysql_query("SELECT NameURLInfo from links");

    while (
    $links = mysql_fetch_array($result)) {
    $name = $links["Name"];
    $url = $links["URL"];
    $info = $links["Info"];

    // Display links
    echo( "
    <a href='$url'>$name</a> : $info <br>");
    }

    ?>
    </blockquote>
    </body>
    </html>
    as i said i get a parse error on line 27. Anyone have any clue why?
    www.iyeinteractive.com - Website Design and Programming
    www.totalnonsense.net - my site, Under Construction

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are missing a " at:

    echo( "<P>Unable to locate the database</P> );


    so....

    echo( "<P>Unable to locate the database</P>");

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Los Angeles, California
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohhhhhh yes i did, thank you
    www.iyeinteractive.com - Website Design and Programming
    www.totalnonsense.net - my site, Under Construction


Bookmarks

Posting Permissions

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