Jump to content

[SOLVED] Help with $update = mysql_query


chinclub

Recommended Posts

I am trying to write a PHP script that will be run by cronjobs that will add interest to all of my members money, however, instead of adding the interest it just sets everyone's money at 0.  What am I doing wrong?

 

<?
include("header.php");

$interest_rate = 2 / 100;
$update = mysql_query("UPDATE `members` SET `bank` = 'bank + (bank*{$interest_rate})'");

	 	if($update) {
		 	print "<h2>Done!</h2>";
		}
		else {
		 	print mysql_error();
		} 

include("footer.php");?>

Link to comment
https://forums.phpfreaks.com/topic/50354-solved-help-with-update-mysql_query/
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.