Jump to content

Please someone help me with this error


DarkHavn

Recommended Posts

What the hell is oing on, this is my following code


[code]

if($_POST['clientsubmit']){
connect(); //Connects to the database


$name = strip_tags($_POST['name']);
$lname = strip_tags($_POST['lname']);
$email = strip_tags($_POST['email']);
$hphone = strip_tags($_POST['phone']);
$cphone = strip_tags($_POST['cphone']);
$password = md5($_POST['pass']);

//$insertquery = 'INSERT INTO agent (name, a_lname, email, phone, cell, pass) VALUES(' . "$name" . ',' . "$lname" . ',' . "$email" . ',' . "$hphone" . ',' . "$cphone" . ',' .  "$password" . ');';
$insertquery = "INSERT INTO agent (name, lname, email, phone, cell, pass) VALUES ($name, $lname, $email, $hphone, $cphone, '$pass');";
if(mysql_query("$insertquery")) {
$_SESSION['success'] = "Thank you, your Agent has been Signed up";
header("Location: ../thanks/thanks.php");
} else {

$error = mysql_error();
echo "$error";
$ip = $_SERVER['REMOTE_ADDR'];
$errormsg = "INSERT INTO information (error, ip) VALUES ($error, $ip);";
mysql_query("$errormsg");
}


}
[/code]

What the following does is just take simple input from a form and insert in into the mysql database, everything matches, the table names etc are correct, but everytime i go to submit it i get this error


"Unknown name in feildlist"  (The name being the section for the agents first name), but then it keeps jumping around, last night when i gave up and when to bed it was complaining that the md5() password wasn't in the feildlist???????


Please help me guys/girls? :(
Link to comment
Share on other sites

Hard to debug this not knowing the tables but try doing this since you are sure the table names are exactly the same:

[code]
"INSERT INTO agent (`name`, `lname`, `email`, `phone`, `cell`, `pass`) VALUES ('$name', '$lname', '$email', '$hphone', '$cphone', '$pass')"
[/code]

Not sure if that will fix it but I would check again and make sure that the field names are really in the table you are using.
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.