$asdf = “select cash from usergame where user_name = ‘$HTTP_SESSION_VARS[user_name]’” or die(mysql_error());
$asdf_res = mysql_query($asdf) or die(mysql_error());
srand ((float) microtime() * 10000000);
while ($cats = mysql_fetch_array($asdf_res)) {
$cash = $cats[‘cash’];
When i try and select cash … cash =0 when it should = something else
I know it finds the row because i put print $cash in that while statement and it prints as 0
Resource id #2
i get that stupid error and i donno why i think thats whats causing cash to not = what it should… help me out eh?
I get this problem too. It normally means your trying to print an SQL query. but that dosen’t look like the case. I would recommend trying to remove as much logic as you can (ie loops etc) and work your way down until you find the problem. Maybe with a little more code I could help you out.
<?
session_start();
$conn = mysql_connect(“localhost”, “Oldschooljdb”, “xxx”);
mysql_select_db(“Berone”,$conn);
$asdf = “select cash from usergame where user_name = ‘$HTTP_SESSION_VARS[user_name]’” or die(mysql_error());
$asdf_res = mysql_query($asdf) or die(mysql_error());
srand ((float) microtime() * 10000000);
while ($cats = mysql_fetch_array($asdf_res)) {
$gold = $cats[“cash”];
print “status=$gold”;
}
?>
i shortened it to that…
is the fact that im using this with actionscript making a different…
i use this to select there cash add score to it and then update it back