Help

    Date: 05/31/05 (PHP Community)    Keywords: php, mysql, sql

    This script always comes out with a Parse error on line 40, and I dont know what to do


    I don't see any syntax errors, and I'm completely new to PHP and MySQL.






    // This script adds guestbook entries to the database.


    // Address error handling.
    ini_set ('display_errors', 1);


    if (isset ($_POST['submit']))
     {if ($db_connect ('localhost', 'name', 'password'){


      if (!@mysql_select_db ('name'))
       die ('

    Could not select the database because: ' . mysql_error() . '

    ');
      }


      } else {
       die ('

    Could not connect to MySQL because: ' . mysql_error() . '

    ');
      }


     // Define the query.
     $query = "INSERT INTO guest_entries (blog_id, name, email, aim, url, location, comments, date)
     VALUES (0,
     '{$_POST['name']}',
     '{$_POST['email']}',
     '{$_POST['aim']}',
     '{$_POST['url']}',
     '{$_POST['location']}',
     '{$_POST['comments']}',
     NOW())";


     // Execute the query.
     if (@mysql_query ($query)) {
      print '

    Thank you "$_POST('name')" for signing my guestbook.

    ';
     } else {
      print "ERROR

    Could not submit guestbook entry because: " . $mysql_error . "."
     }


     mysql_close();



    ?>






    What could be wrong here?

    To my knowledge, I'm running MySQL 3.23.56, but I'm not sure. I'm on the 100webspace server.

    Source: http://www.livejournal.com/community/php/302360.html

« SESSION problems || login/shopping cart across... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home