0
<?php

$cardno = $_POST['cardno'];
$c_status = $_POST['c_status'];
$V_idno = $_POST['V_idno'];
$c_name = $_POST['c_name'];
$m_name = $_POST['m_name'];
$f_name = $_POST['f_name'];
$Phone = $_POST['Phone'];
$email = $_POST['email'];
$profession = $_POST['profession'];
$age = $_POST['age'];
$sex = $_POST['sex'];
$m_status = $_POST['m_status'];
$address = $_POST['address'];
$District = $_POST['District'];

if(!$con)
{
    die ('could not connect'.mysql_error());
}
    mysql_select_db('fastcashcard',$con)

    mysql_query("INSERT INTO cardinfo('cardno','c_status','V_idno','c_name','m_name','f_name','Phone',`email`,'age','sex','m_status', 'address','District') 
VALUES('$cardno','$c_status','$V_idno','$c_name','$m_name','$f_name','$Phone','$email', '$profession', '$age', '$sex','$m_status','$address','$District')");

echo "Your record successfully Inserted";

mysql_close($con);

?>
4
Contributors
3
Replies
17
Views
4 Years
Discussion Span
Last Post by broj1
0

see your backtick on your email field of line 24 ('cardno','c_status','V_idno','c_name','m_name','f_name','Phone',email,'age','sex','m_status', 'address','District')

0

Change the quotes on email to be single quotes. So, your code should be;

     mysql_query("INSERT INTO cardinfo('cardno','c_status','V_idno','c_name','m_name','f_name','Phone','email','age','sex','m_status', 'address','District') 
        VALUES('$cardno','$c_status','$V_idno','$c_name','$m_name','$f_name','$Phone','$email', '$profession', '$age', '$sex','$m_status','$address','$District')");
0

On line 22 you are missing a semicolon on the end of the statement.

In the query all the field names should be enclosed in backticks and not in single quotes (a mysql syntax requirement).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.