Bullet Posted September 3, 2008 Share Posted September 3, 2008 Well basically, i want to equip something but it won't work; //HTML SIDE; $attempts_on_u=mysql_query("SELECT * FROM inventory WHERE username='$username' AND type='House' ORDER by id DESC"); while($fucker=mysql_fetch_object($attempts_on_u)){ echo " <tr> <td class=TableArea>House</a></td> <td class=TableArea>$fucker->name</td> <td class=TableArea> <a href='?use&id=$fucker->id'>Use</a></td> </tr>"; } ?> /// CODING; if(($use) && ($id)){ $poo=mysql_query("SELECT * FROM inventory WHERE type='House', id='$id', username='$username'"); $rows=mysql_num_rows($poo); if($rows == "0"){ print "<p class='warning'>Error. There is no such house please try again.<META HTTP-EQUIV='Refresh' CONTENT='1; URL=Inventory.php'></p>"; }else{ $get=mysql_fetch_object(mysql_query("SELECT * FROM inventory WHERE username='$username' AND id=$id' AND type='House'")); mysql_query("UPDATE users SET house='$get->name' WHERE username='$username'"); echo"You are now using $get->name as your house. <META HTTP-EQUIV='Refresh' CONTENT='1; URL=Inventory.php'>"; }} Link to comment https://forums.phpfreaks.com/topic/122569-choosing/ Share on other sites More sharing options...
Bullet Posted September 3, 2008 Author Share Posted September 3, 2008 ??? Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-632927 Share on other sites More sharing options...
jordanwb Posted September 3, 2008 Share Posted September 3, 2008 What's the problem? And what's with your variable names? Also this line: if($rows == "0"){ By all rights should be: if($rows == 0){ Because mysql_num_rows returns an integer. Thirdly (or is that fourthly?), your code looks an SQL injection attack waiting to happen. Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-632932 Share on other sites More sharing options...
Bullet Posted September 4, 2008 Author Share Posted September 4, 2008 Makes no difference. any help? been a day now :| Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-633695 Share on other sites More sharing options...
Bullet Posted September 4, 2008 Author Share Posted September 4, 2008 Cmon, I'm sure someone out there is smart enough. Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-633762 Share on other sites More sharing options...
jordanwb Posted September 4, 2008 Share Posted September 4, 2008 Well what are you trying to do? Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-633782 Share on other sites More sharing options...
Bullet Posted September 4, 2008 Author Share Posted September 4, 2008 Well I'm trying to use that house, so it equips. but it doesn't work, just refreshes the page. Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-633830 Share on other sites More sharing options...
jordanwb Posted September 4, 2008 Share Posted September 4, 2008 What do you mean it doesn't work? It refreshes because you have the refresh meta tag appear after "You are now using...". Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-634030 Share on other sites More sharing options...
trq Posted September 4, 2008 Share Posted September 4, 2008 Bullet, complaining that its been a day now won't get us anywhere. You have failed to ask a question and actually explain your issue. Help us help you, explain (in detail) what your trying to do and what is actually happening. Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-634076 Share on other sites More sharing options...
jordanwb Posted September 4, 2008 Share Posted September 4, 2008 Would it be wrong to tell him to ask for a refund? Link to comment https://forums.phpfreaks.com/topic/122569-choosing/#findComment-634081 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.