Page 1 of 1

Updates of an php based online game

Posted: Mon Jun 07, 2004 3:00 pm
by mr-punkstar
OKay, my idea is, that I save nessacery queries in a table in a mysql database. I my manager name was nick, and i had a £200 bill on my account, would the query look like this!?

Code: Select all

UPDATE money(++200) FROM clubinfo WHERE username = 'nick'
I really doubt it very very much. But there is nowhere i can look on the internet, and this forum is my php answer heaven!!

Also, how would I run the queries that where in the database?

Code: Select all

<?php
include("config.php");

//query to find the update query
$updatequery = "SELECT query FROM update";

$result = mysql_query($updatequery, $connect);
$resultfinal = mysql_query($result, $connect);

?>
I have got a weird feeling that this is wrong also, but then again, I am new to the lanaguage, and 15 years old, so the only way is up.

Lol

Any feedback would be greatly appreciated!!

Nick!

Posted: Mon Jun 07, 2004 3:13 pm
by feyd
UPDATE `clubinfo` SET `money` = `money` + 200 WHERE `username` = 'nick'

I think...

As for finding what the new value is:

SELECT `money` FROM `clubinfo` WHERE `username` = 'nick'