LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PLS how do i solve this ish? (https://www.linuxquestions.org/questions/programming-9/pls-how-do-i-solve-this-ish-944043/)

shygvy 05-09-2012 06:54 AM

PLS how do i solve this ish?
 
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\content.php on line 40

while($page = mysql_fetch_array($page_set)){
echo "<li";
if ($page ["id"]==$sel_page){
echo "class=\"selected\"";
}
echo"><a href=\"content.php? page=" . urlencode($page["id"]).
"\">{$pages["name"]}</a></li>";
}
my line 40 is
while($page = mysql_fetch_array($page_set)){

Nylex 05-09-2012 07:00 AM

I've reported this as a double post of your other thread, since the two are closely related.

Also, as per the LQ rules, please write out your words in full.

NevemTeve 05-09-2012 07:30 AM

Always check for errors after mysql_query:

Code:

$result= mysql_query ($stmt);
if ($result===FALSE) {
    printf ("<H1>Error in '%s': '%s'</H1>\n",
    htmlspecialchars ($stmt),
    htmlspecialchars (mysql_error ()));
    exit (1);
}


crabboy 05-09-2012 11:50 AM

shygvy, please post the same question in one thread only. As Nylex pointed out, you posted the same question as a followup in your original thread. It's okay to do either, just not both.


All times are GMT -5. The time now is 03:43 PM.