$resourcesbuilt = mysql_query("SELECT resourcesbuilt FROM user WHERE username = '$username' LIMIT 1");
if ($resourcesbuilt<=0 )
{
mysql_query("INSERT INTO resources (username, dollars) VALUES ( '$username', '1000')") or die (mysql_error());
mysql_query("UPDATE user SET resourcesbuilt = '1' WHERE username = '$username'");
}
Basically I have a column in a user table that acts as a flag that tells me whether a different table has been made for that particular user. Its 0 if it hasn't, and 1 if it has. However it seems I can't just store the query into a variable and check if its 0 or not, because the actual value from the query isn't stored in the var. When I echo the var it just says Resource id #3. My research into php and SQL has failed me. Does anyone know of a way to store the result form a sql query into a variable in php? Or can at least point me in the right direction? Thanks in advance.