I am just wondering if anyone knows of a way to consolidate the code below I am relativly new at php and need the advice $result = mysql_query("SELECT energy FROM playerstats WHERE name = 'Moki'"); $row = mysql_fetch_array($result); if ($row['energy'] < 2) { include("jobnotenoughenergy.php"); } else { Code (markup): Thank you in advance, Brandon A.K.A Moki Mofiki
I don't know what you need to "consolidate", try this? $r = mysql_query("SELECT energy FROM playerstats WHERE name = 'Moki'"); if (mysql_result($r, 0); < 2) include("jobnotenoughenergy.php"); else { ... } PHP: