Whats wrong with this php code? - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Whats wrong with this php code? (/showthread.php?tid=80621) Whats wrong with this php code? by Quantum on 01-02-2008 at 06:34 PM
code: Thanks for your help RE: Whats wrong with this php code? by saralk on 01-02-2008 at 06:46 PM
I can't really help without the error messages, and it's a while since I have used php, but I don't think you can copy an array like that. You would need some sort of counter. code: I can't remember if $row_tag is an array or not. But something along those lines. RE: Whats wrong with this php code? by Quantum on 01-02-2008 at 06:50 PM Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [FILE LOCATION] RE: Whats wrong with this php code? by MeEtc on 01-02-2008 at 08:09 PM Try running the query in PMA. It will fail there. You are sorting by COUNT(id) when you are not declaring it in the SELECT clause. and COUNT(id) will be a constant number anyway. RE: Whats wrong with this php code? by win_crook on 01-02-2008 at 08:21 PM
code: That should work for the query Also that array copying code doesn't look right either like saralk was saying. So try this: code: You need to overwrite your while loop with that second piece of code. Good Luck RE: Whats wrong with this php code? by Quantum on 01-02-2008 at 09:11 PM
while ($row_tag = mysql_fetch_array($query_tags)) { RE: Whats wrong with this php code? by win_crook on 01-02-2008 at 09:52 PM
Yeah.. it's saying it can't get the results from the query because the query failed. So you need to find out what is wrong with the query. Did you try replacing it with that code I gave you? RE: Whats wrong with this php code? by ShawnZ on 01-02-2008 at 10:40 PM
quote: huh? what doesn't look right about it? RE: Whats wrong with this php code? by Quantum on 01-02-2008 at 11:36 PM
$row = mysql_fetch_array($confresult); RE: Whats wrong with this php code? by Ezra on 01-02-2008 at 11:41 PM
Why are you ordering your results by the number of rows? RE: Whats wrong with this php code? by -dt- on 01-03-2008 at 01:37 AM
quote:yes you can $Array[] = 'aa'; is just like using Array_push($Array, 'aa'); RE: RE: Whats wrong with this php code? by andrewdodd13 on 01-03-2008 at 12:47 PM
quote:NOTHING is wrong with this, as it's been said. The problem is that you are passing an invalid result as $confresult fails because of your invalid SQL statement. RE: Whats wrong with this php code? by Spunky on 01-03-2008 at 03:37 PM
Best thing to do with the query is run it in PHPMyAdmin in the SQL window. Problems will be shown and you can copy & paste when you get it working. RE: Whats wrong with this php code? by ShawnZ on 01-03-2008 at 05:26 PM but everyone just told him what was wrong! |