Updates of an php based online game

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mr-punkstar
Forum Newbie
Posts: 19
Joined: Mon May 31, 2004 1:12 pm

Updates of an php based online game

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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'
Post Reply