Jump to content

MYSQL Update not Working


Monk3h

Recommended Posts

if ($step == upgrade) {

if ($stat[bank] < $bankmin) {

Print "You do not have the required funds in your account to Upgrade! Please transfer the required funds!";

}else{

mysql_query("update players set bankaccount=$newbank[name] where id=$stat[id]");

Print "You have successfully upgraded your account to our $newbank[name]";

}}

 

Can anyone tell me why this isnt working? Its displaying the text when i upgrade saying iv upgraded. But it dosnt  change the bankaccount feild in Players to the new Bank account. :s

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

Whenever you are having problems with a query there should always be two things you do before anything else...

 

1) echo out your query...

$query = "update players set bankaccount=$newbank[name] where id=$stat[id]";
echo $query;
mysql_query($query);

 

2) show the mysql error(s)...

$query = "update players set bankaccount=$newbank[name] where id=$stat[id]";
echo $query;
mysql_query($query) or die(mysql_error());

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.