Hi, I have a game I am making, and in one of the files, php will decide if it wants to exacute the sql. If someone could look at it, that would be nice. <?php if (!isset($_SESSION)) { session_start(); } $bullshit = true; //Cause im mad and it's not working if ($bullshit) { include "header.php"; $con2 = mysql_connect($dhost, $dusername, $dpassword) or die("Cannot Connect"); mysql_select_db($ddatabase, $con2); $id = 100;//halen("select id from us_members where username='".$_COOKIE['Username']."' "); $iId = 5;//halen("select itemId from us_items where ownerId='".$id."' && id='".$_GET['itemid']."'"); $top = 't';//halen("SELECT type from us_itemTypes WHERE itemid='".$iId."'"); $inuse = halen("SELECT inuse FROM us_items WHERE id='50'"); if ($iId == '' || $iId == null) { echo "You don't own this item!"; include "footer.php"; exit; } $item = mysql_query("select * from us_itemTypes where itemId=$iId limit 1"); $item = mysql_fetch_array($item); if ($inuse == 0){ if ($top == "t"){ mysql_query("Update us_members set c_top='5' where username='jerry'",$con2); } mysql_query("Update us_items set inuse='1' where id='50'",$con2); mysql_query("Update us_members set def=def+10 where username='jerry' limit 1",$con2); echo "Item has been equipped!"; } else { if ($top == "t"){ mysql_query("Update us_members set c_top='0' where username='jerry'",$con2); } mysql_query("Update us_items set inuse='0' where id='50'",$con2); mysql_query("Update us_members set def=def-10 where username='jerry' limit 1",$con2); echo "Item has been un-equipped!"; } } include "footer.php"; Code (markup): That is the whole page, but if ($inuse == 0){ if ($top == "t"){ mysql_query("Update us_members set c_top='5' where username='jerry'",$con2); } mysql_query("Update us_items set inuse='1' where id='50'",$con2); mysql_query("Update us_members set def=def+10 where username='jerry' limit 1",$con2); echo "Item has been equipped!"; } else { if ($top == "t"){ mysql_query("Update us_members set c_top='0' where username='jerry'",$con2); } mysql_query("Update us_items set inuse='0' where id='50'",$con2); mysql_query("Update us_members set def=def-10 where username='jerry' limit 1",$con2); echo "Item has been un-equipped!"; } Code (markup): is the part not working. :cry:
What kind of error are you getting that's stopping you? I see tons of stuff wrong that could potentially stop this from executing...