Jump to content

[SOLVED] INSERT INTO problem?


burtybob

Recommended Posts

$question=$_REQUEST['question'];
$title=$_REQUEST['title'];
$a1=$_REQUEST['answer1'];
$a2=$_REQUEST['answer2'];
$a3=$_REQUEST['answer3'];
$a4=$_REQUEST['answer4'];
$a5=$_REQUEST['answer5'];
$sql=mysql_query("INSERT INTO polls (`title`,`question`,`answer1`,`answer2`,`answer3`,`answer4`,`answer5`,`dt`) VALUES ('$title','$question','$a1','$a2','$a3','$a4','$a5',NOW()");
if ($sql){                   //everything between here 
$message="New Poll Added";
} else {
$message="A problem in adding new poll";
}                           // and here is just for general information and conformation to the 
                            //staff so we know if poll was added or not

 

Ok this is the code i have and it keeps showing the A problem in adding new poll

Yet i cannot see why please can somone help me?

Link to comment
Share on other sites

Can you do me a favour? Change it to this:

 

$question=$_REQUEST['question'];
$title=$_REQUEST['title'];
$a1=$_REQUEST['answer1'];
$a2=$_REQUEST['answer2'];
$a3=$_REQUEST['answer3'];
$a4=$_REQUEST['answer4'];
$a5=$_REQUEST['answer5'];
$sql=mysql_query("INSERT INTO polls (`title`,`question`,`answer1`,`answer2`,`answer3`,`answer4`,`answer5`,`dt`) VALUES ('$title','$question','$a1','$a2','$a3','$a4','$a5',NOW()") or die(mysql_error());

 

and tell me what it says.

Link to comment
Share on other sites

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.