php problem with mysqli_query "INSERT"?

Joe B

New member
k just would like to say thanks to the ppl who have been helping me out so far. i am making serious progress. my next issue is this:
when i try to insert data for new users into a mysql database table through a mysqli_query in php, the query appears successful, but simply does not insert the data. here is some code....

$mysqli = mysqli_connect("localhost", "root", "gotenks", "bpa_site");

$sql = "INSERT INTO user_info (usernames, passwords, f_name, l_name, email)
VALUES ('".$_POST['Login_name']."', '".$_POST['Password']."', '".$_POST['First_name']."', '".$_POST['Last_name']."', '".$_POST['Email']."');";
$result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));

echo $sql;
echo $result;


here is the output...

INSERT INTO user_info (usernames, passwords, f_name, l_name, email) VALUES ('blah', 'blahblah', 'bob', 'george', '[email protected]');1

the "1" at the end says it was a success, but when i try to login as this user, it tells me that the data is not in the table

is there anything wrong with this chunk of code? if not i can post more. I am copying this stuff straight out of a book, but so far the book has been wrong before...

Thanks much in advance.
EDIT: nvm, i was not inserting the password as a PASSWORD()...
 
Back
Top