Click to See Complete Forum and Search --> : PHP 4 and MYSQL 4 REPLACEing problems


thaddaeus
07-29-2004, 01:11 PM
I've been stumped the last few days on this, i know i did somthing wrong somewhere, but i can't seem to understand it, the mysql and php site documents suck, so heres the idea. I need to be able to edit a specific column for a specific user, known by the users id number, now what i think the problem is, is in my edit function...

function EditUserInDB($DB_Connect, $entry, $idNum, $temp)
{
$sql = "REPLACE INTO _user (userID, $entry) $idNum VALUES ($idNum, '$temp') ";
mysql_query($sql, $DB_Connect);
}

i've tried hard coding in nickname in the $entry position, but that changed nothing so its not that, i don't get any parse errors, Even if i was passing the wrong variables into temp and $entry, i know the idNum is getting passed through, which should effect that entry. if you want the full script just ask and i'll give you only what you need to see for security reason :) thanks for anyhelp, and obviously i need some new eyes because its probably somthing small. thanks

thaddaeus
07-29-2004, 01:23 PM
i thought i had fixed it but now, it accpets the signle change, but it erases all the other fields for that user, so if i change the user name the password, email dissappear...

Choozo
07-29-2004, 02:20 PM
What about:$sql = "update tablename set colname='$value' where some_unique_colval='somevalue'"

thaddaeus
07-29-2004, 03:35 PM
The real question i ask my self now should be why I didn't think of that? thanks...