[thelist] Random Page Titles is it possible with php/MySQL

Jay Blanchard jay.blanchard at niicommunications.com
Thu Sep 18 06:32:53 CDT 2003


[snip]
while (($myrow = mysql_fetch_array($result)))
{
echo "<title>$page_title"</title>;
}

Any pointers as to where I'm going wrong?
[/snip]

Yep. You ask for an array in your while statement, but your echo
statement does not reference the array;

echo"<title>".$myrow['page_title']."</title>";

Now, if your array doesn't come back with that reference you can see
what it returns by doing this;

while (($myrow = mysql_fetch_array($result)))
{
print_r($myrow); // outputs your array in key value pairs
}


More information about the thelist mailing list