corruptcity || skalman Posted September 7, 2010 Share Posted September 7, 2010 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 Quote Link to comment Share on other sites More sharing options...
Analog Posted September 7, 2010 Share Posted September 7, 2010 Have you made sure you are only calling the function once? Quote Link to comment Share on other sites More sharing options...
corruptcity || skalman Posted September 7, 2010 Author Share Posted September 7, 2010 yeah i have Quote Link to comment Share on other sites More sharing options...
Dave Posted September 7, 2010 Share Posted September 7, 2010 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? Quote Link to comment Share on other sites More sharing options...
Armageddon Posted September 7, 2010 Share Posted September 7, 2010 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. :) Quote Link to comment Share on other sites More sharing options...
Djkanna Posted September 7, 2010 Share Posted September 7, 2010 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. Quote Link to comment Share on other sites More sharing options...
Armageddon Posted September 7, 2010 Share Posted September 7, 2010 Ah... Thanks Dj. Was looking around internet for awhile, but couldn't find answer. Quote Link to comment Share on other sites More sharing options...
corruptcity || skalman Posted September 7, 2010 Author Share Posted September 7, 2010 its ok problem sovled id made a cock up with the query this might aswell be deleted now Quote Link to comment Share on other sites More sharing options...
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.