Jump to content

mySQL update?


RON_ron

Recommended Posts

my code with the problem:

 

$res = sprintf("UPDATE student SET Pas = '%s' WHERE Mail = '%s'", mysql_real_escape_string($Ber), mysql_real_escape_string($Mail));

$resDone = mysql_query($res);

 

I can not get this work? I don't see any mistake in this code?? Could someone please help...

I tried echo ($res)... it was blank? (I can assure the variable names are correct)

Link to comment
https://forums.phpfreaks.com/topic/267786-mysql-update/
Share on other sites

$query3 =sprintf("SELECT * FROM student WHERE Mail ='%s' AND Usr = '1'", mysql_real_escape_string($Mail));
$query3a = mysql_query($query3);
if(mysql_num_rows($query3a) > 0){
$res = sprintf("UPDATE student SET Pas = '%s' WHERE Mail = '%s'", mysql_real_escape_string($Ber), mysql_real_escape_string($Mail));
$resDone = mysql_query($res);
}

Link to comment
https://forums.phpfreaks.com/topic/267786-mysql-update/#findComment-1373768
Share on other sites

Archived

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

×
×
  • Create New...

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.