1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I am getting a parse error on line 7 of this code can anyone please tgell me what is wrong?

    Thanks Tim


    $conn = mysql_connect("localhost", "user", "pass");

    if (!$res) {
    print mysql_error();
    print &quot;<pre>$ins</pre>&quot;

    mysql_select_db("timesheets"); /* <-- Use correct DB name here */

    /* Create SQL Insert statement */

    $ins = "insert into paysheet (
    employeename, address, city, state, country, employeenumber,
    socialsecurity, projectname, clientname, clientnumber,
    paystartday, payfinishday, totalhours,
    overtime_hours, accept)*/
    '$employeename', '$address', '$city', '$state', '$country', '$employeenumber',
    '$socialsecurity', '$projectname', '$clientname', '$clientnumber',
    '$paystartday', '$payfinishday', '$totalhours',
    '$overtime_hours', '$accept')";

    $res = mysql_query($ins, $conn);

    if (!$res) {
    print "Error inserting into database<br>";
    print "<PRE>$ins</PRE>";

    print "Thank you";

  2. #2
  3. No Profile Picture
    rod k
    Devshed Newbie (0 - 499 posts)
    Hehe, aren't these frustrating sometimes?

    The problem with PHP errors are that this particular error is in line 6 but it reports it in line 7 cause that's where the interpreter is when it figures out there's a problem.

    You need a semicolon at the end of your print statement on line 6.

    [This message has been edited by rod k (edited 12-06-99).]

Similar Threads

  1. *sigh*
    By vb.net in forum Dev Shed Lounge
    Replies: 45
    Last Post: November 9th, 2003, 07:52 PM
  2. Replies: 0
    Last Post: April 27th, 2002, 07:40 AM
  3. if-statement functioning wrong
    By Dekers in forum Perl Programming
    Replies: 6
    Last Post: March 31st, 2002, 09:23 PM
  4. PHP shows wrong Line number for errors
    By sarmadys in forum PHP Development
    Replies: 7
    Last Post: February 12th, 2002, 12:07 AM

IMN logo majestic logo threadwatch logo seochat tools logo