Jump to content

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','asd@gmail.com','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]";

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.