Hi,
I am using chronoform "form wizard" and i am inserting my form details to the database table manually. So, I used php script in the custom code action on the submit event. Whenever am submitting the form, the datas are inserting to db table succesfully but it is giving this warning.
My code is
I dont know what i am missing... Anyone help me to fix this.
Thanks in advance
thoufiq
I am using chronoform "form wizard" and i am inserting my form details to the database table manually. So, I used php script in the custom code action on the submit event. Whenever am submitting the form, the datas are inserting to db table succesfully but it is giving this warning.
warning mysql_fetch_array() expects parameter 1 to be resource boolean given in.....
My code is
<?php
$connect = mysql_connect("localhost", "name", "password");
if(!$connect)
{
die ("Could not connect".mysql_error());
}
$select_db = mysql_select_db("db_name",$connect);
if(!$select_db)
{
die ("Could not connect".mysql_error());
}
$name = $_POST['your_name'];
$email = $_POST['your_email'];
$location = $_POST['your_location'];
$code = $_POST['chrono_verification'];
$enq_ques = $_POST['enq_ques'];
$query = mysql_query("INSERT INTO form_enquiry (name, email, location, code, enq_ques) VALUES ('$name', '$email', '$location', '$code', '$enq_ques')", $connect);
if(!$query)
{
die ("Query failed".mysql_error());
}
while ($result = mysql_fetch_array($query))
{
echo $result['name']."<br />";
echo $result['email']."<br />";
echo $result['location']."<br />";
echo $result['code']."<br />";
echo $result['enq_ques']."<br />";
}
mysql_close($connect);
?>
I dont know what i am missing... Anyone help me to fix this.
Thanks in advance
thoufiq