EineyEntertainment Posted March 16, 2009 Posted March 16, 2009 Ok this is driving me banana's, but I cannot get a script to work. I'm trying to set it up so that when you use an item, it redirects you to a diferent page. (I already figured that out lol) Once at the page, I would love for the page to check the persons inventory to see if that item is there, and if it is...allow the user to use the page. Something on the lines of $i=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET[iD]} AND iv.inv_userid=$userid"); } if(!$db->num_rows($i)) { print "<h2>Oops</h2>Invalid item ID"; } else { $r=$db->fetch_row($i); if($r[itmid] == 20) then afterwards you can have access to the page. Pretty much, I'm trying to make it required to have a mining pick before going mining Quote
DissObey Posted March 16, 2009 Posted March 16, 2009 Re: Need an item to access a page $itemid = 1; $i=$db->query("SELECT * FROM inventory WHERE inv_itemid=$itemid AND inv_userid=$userid"); if(mysql_num_rows($i) == 0) { print "<h2>Oops</h2>Invalid item ID"; $h->endpage(); exit; } Try that, change 1 to the item id required. Quote
EineyEntertainment Posted March 16, 2009 Author Posted March 16, 2009 Re: Need an item to access a page If I tell you that I love you....you wouldn't take that the wrong way would you? :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.