Click to See Complete Forum and Search --> : xml with php
pharon
09-02-2006, 12:01 PM
i made php file to make rss but i have erorr
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
the erorr line
while($result = mysql_fetch_array($doGet)){
DJsAC
09-02-2006, 12:20 PM
the $doGet is probably empty.
post the code for more help. Without it all we can do is guess ;)
pharon
09-02-2006, 12:23 PM
<?
$q="SELECT id,title,body,UNIX_TIMESTAMP(pubDate) AS pubDate
FROM articles LIMIT 0,15 ORDER BY pubDate DESC";
$doGet=mysql_query($q);
while($result = mysql_fetch_array($doGet)){
?>
NogDog
09-02-2006, 12:27 PM
That error almost always means that MySQL was unable to parse and process your query. Try this format to get some debug info:
$doGet=mysql_query($q) or die("Query failed: $q - " . mysql_error());
pharon
09-02-2006, 12:28 PM
Query failed: SELECT id,title,body,UNIX_TIMESTAMP(pubDate) AS pubDate FROM articles LIMIT 0,15 ORDER BY pubDate DESC - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY pubDate DESC' at line 2
NogDog
09-02-2006, 12:41 PM
I think the LIMIT clause has to come after the ORDER BY clause.