Jump to content

can you help me please?


asherinho

Recommended Posts

i am havin this error and i dnt know what is its cause.

 

 

error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES('asheri','student','[email protected]','1', 'preety good')' at line 1

 

here are the codes:

<?php

$db=mysql_connect("localhost","root");

if (!$db){

  echo"Could not connect: " . mysql_error();}

mysql_select_db("trials",$db);

$query="INSERT INTO viewz(name,title,mail,choice,comments,) VALUES('$_POST[name]','$_POST[title]','$_POST[mail]','$_POST[choice]',

'$_POST[comments]')";

$result=mysql_query($query);

if(!$result){echo "error:".mysql_error();}

echo "<br><a href='views.html'>back to the form</a>";

?>

Link to comment
https://forums.phpfreaks.com/topic/62805-can-you-help-me-please/
Share on other sites

not sure wd ds....but try ds 1...

 

<?php

$db=mysql_connect("localhost","root");

if (!$db){

  echo"Could not connect: " . mysql_error();}

mysql_select_db("trials",$db);

$query="INSERT INTO viewz(name,title,mail,choice,comments,) VALUES('".$_POST[name]."','".$_POST[title]."','".$_POST[mail]."','".$_POST[choice]."',

'".$_POST[comments]."')";

$result=mysql_query($query);

if(!$result){echo "error:".mysql_error();}

echo "

<a href='views.html'>back to the form[/url]";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.