I'm having a problem with the result coming up as 0 so it just says I have "no energy left", which isn't the case.
Here's the part of the code that isn't working right. Any help would be AWESOME! Thanks!
<?php
function fish($username){
$data = ""; $dbh=dbconnect() or die ('Fish error: ' . mysql_error()."<br>");
mysql_select_db("katarra_game");
$result = mysql_query("SELECT * FROM users WHERE username = '$username'");
if (mysql_num_rows($result) > 0) $data = stripslashes(mysql_result($result,0,$var));
mysql_close($dbh);
$data = str_replace("&#39;","'",$data);
return $data;}
$data = $user;
$expgain = 1;
$expgain2 = 2;
if ($user->energy <= 0)
{
echo "You have no energy left!" ;
exit;
}