Jump to content
MakeWebGames

wierd problem


corruptcity || skalman

Recommended Posts

hi ive got a wierd problem with this function but the problem did happen straigt after i coded it it wasnt til after i added a few more function to the whole script that it started giving me this problem and the problem is that it shows double the records from the db i.e if you had 2 records in the table t would show 4 when you run the code and 2 would have the same ID as would the other 2

ive gone thru it and i cant seem to find anythink wrong with it but here it is

Link to comment
Share on other sites

Hm..

I don't think all that DB Query crap is needed. Might want to use something like this. :)

 

$mags = $db->query("SELECT `itmname` , `pa_rounds_left` , `pa_rounds` , `pm_id` , `itmid`  
                   FROM `players_mags` 
                   LEFT JOIN `items` ON `itmid` = `pm_itmid` // Can ==(Equals) be used on Querys, and still be valid?
                   LEFT JOIN `players_ammo` ON `pm_itmid` = `pa_itmid`    
                   WHERE `pm_userid` = ".$ir['userid']." AND `pm_itmid` = ".abs(@inval($_GET['WID']));

I don't think all the query is needed like that. But anyway, should still work. :)

Link to comment
Share on other sites

Your echo'ing the text inside a function? Surely return would be a better option then echo the whole function out?

Or you could return the data as an array then "foreach" it where you wan't it to show?

Hm..

I don't think all that DB Query crap is needed. Might want to use something like this. :)

$mags = $db->query("SELECT `itmname` , `pa_rounds_left` , `pa_rounds` , `pm_id` , `itmid`  
                   FROM `players_mags` 
                   LEFT JOIN `items` ON `itmid` = `pm_itmid` // Can ==(Equals) be used on Querys, and still be valid?
                   LEFT JOIN `players_ammo` ON `pm_itmid` = `pa_itmid`    
                   WHERE `pm_userid` = ".$ir['userid']." AND `pm_itmid` = ".abs(@intbal($_GET['WID']));

I don't think all the query is needed like that. But anyway, should still work. :)

= is equals to, doesn't mean assign like it does in PHP.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...