In message <[EMAIL PROTECTED]>, Stephen <[EMAIL PROTECTED]> writes >I am trying to inset data into my database but I am recieving the >following error: > >PHP Parse error: syntax error, unexpected T_VARIABLE in C:\\Program >Files\\Apache Software Foundation\\Apache2.2\\htdocs\\PHP\\insert.php >on line 43, referer: http://ve1mpf.no-ip.org/php/input_log.php > ><?php > $con = mysql_connect("localhost:","root","xxxx"); > if (!$con) > { > die('Could not connect: ' . mysql_error()); > } > mysql_select_db("logbookS", $con); > mysql_query('INSERT INTO log (Callsign, Band, Freq, Mode, >Cont, Name_info, RST_Sent, RST_Rec, Time, Date, PFX, Operator) Values >('$_POST[Callsign]','$_POST[Band]','$_POST[Freq]','$_POST >[Mode]','$_POST[Cont]','$_POST[Name_info]','$_POST[RST_Sent]','$_POST >[RST_Rec]','$_POST[Time]','$_POST[Date]','$_POST[PFX],'$_POST >[Operator]')'); > if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error >()); > } > echo "1 record added"; > mysql_close($con) > >?> > >Can anyone tell me where I am going wrong? >Thanks >Stephen
I would expect that it is the mysql_query line. I always like to setup the query as $qry="INSERT INTO LOG... then mysql_query($qry); If you did it that way, you would see that your single quotes around the POSTs are wrong. -- Pete Clark Sunny Andalucia http://hotcosta.com/Andalucia.Spain
