I would like to insert 4 values into a database row that has 10+ fields. How might I go about doing this?
Currently I am trying...
"INSERT INTO $user_tablename2 (idnumber, userid, memberpassword, swgname) VALUES(NULL, $user_id, password($user_password), '$swg_name')"
as the query string but i get an sql error message saying that the userid entered in the form is not a recognized field.
Anyone?
inserting some not all values into a row of a database
Moderator: General Moderators
Code: Select all
"INSERT INTO $user_tablename2 (idnumber, userid, memberpassword, swgname) VALUES('', '$user_id', password('$user_password'), '$swg_name')"added some single quotes around $variables
Does that work?
alright now it is kind of working, like the userid and the swgname are set to the correct values but the password is either not passed at all or not set, but it doesn't seem to be in the database at all, and thus my log in pages aren't working and this starts a domino effect, so any ideas on how to get the password to stay?
before the query... create a new variable and get the value of $user_password in there.
technically I doesn't make sense since the senario is not changes much.... but I had faced smilar problem once and this is how it was solved.. I couldn't understand why, thus couldn't explain why yuo should do it... but try as you might.
Code: Select all
<?
$upass = $_GET['user_password'];
$myQuery = "INSERT INTO $user_tablename2 (idnumber, userid, memberpassword, swgname) VALUES('', '$user_id', password('$upass'), '$swg_name')"
?>