![]() |
|
#2
|
|||
|
|||
|
This is the query I am using and it works great.
Code:
$query = "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
$result = mysql_query($query);
$num = mysql_numrows($result);
$i = 0;
while ($i < $num) {
$money = @mysql_result($result, $i, "money");
$newbalance = $money - $cost;
$i++;
}
mysql_query("UPDATE `adopts_users` SET `money`='" . $newbalance . "' WHERE `username`='$loggedinname'");
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Troubles with queries | pachoofoosh | Questions and Supports | 4 | 08-05-2013 11:32 AM |
| Question about Queries? | Tsuntsun | Questions and Supports | 2 | 11-03-2011 01:57 PM |
| MySQL: What to do? | Knyfe | Questions and Supports | 18 | 03-11-2011 12:52 PM |
| Anyone care to enlighten me as to why 188 queries are used on a page? | Arianna | Questions and Supports | 5 | 05-14-2010 09:21 AM |
| mySQL help | aroymart | Questions and Supports | 4 | 04-20-2009 12:13 AM |
What's New? |
What's Hot? |
What's Popular? |