Jump to content


This topic is now archived and is closed to further replies.


please someone help

Recommended Posts

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


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";
$errormsg = "INSERT INTO information (error, ip) VALUES ($error, $ip);";


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? :(

Share this post

Link to post
Share on other sites
check that the query will run independantly.....

comment out the if statement that subits teh query and echo out the string you have generated to the screen, copy and paste it into phpmyadmin adn run the query - se what errors are returned and come back if you need more help.

Share this post

Link to post
Share on other sites


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.