Jump to content


please someone help

  • Please log in to reply
1 reply to this topic

#1 DarkHavn

  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 21 August 2006 - 11:53 PM

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

#2 ToonMariner

  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 22 August 2006 - 12:13 AM

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.
follow me on twitter @PHPsycho

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users