PDA

View Full Version : [SOLVED] PHP + MySQL, Call to undef function



ladjack
May 26th, 2008, 07:44 PM
Hello, everybody =)

here is my problem:


Fatal error: Call to undefined function mysql_fetch_array() in /home/ladjack/public_html/News/news.php on line 20

here is line #20:


while($Years = mysql_fetch_array($resS))

what could it be? I have php5-mysql installed, extensions such as 'mysql.so' and 'mysqli.so' are enabled and corresponding files exists.

thnx in advance =)

LaRoza
May 26th, 2008, 08:01 PM
Do the other MySQL functions work? If you installed these modules after starting Apache/PHP, you'll have to restart it.

ladjack
May 26th, 2008, 08:08 PM
Do the other MySQL functions work?

For example: mysql_num_row() works great, 'mysql_connect' and 'mysql_select_db' also.

LAMP installation instructions from here (https://help.ubuntu.com/community/ApacheMySQLPHP?action=show&redirect=LAMP)

Verminox
May 26th, 2008, 08:24 PM
What about mysql_fetch_assoc? Can you post the rest of the code?

ladjack
May 26th, 2008, 08:33 PM
What about mysql_fetch_assoc? Can you post the rest of the code?



...skip
connecting to mysql server...
selecting db...
...skip

$sqlS = "SELECT Year_Name FROM Years";
$resS = mysql_query($sqlS);

if(!$resS)
{
echo "Could not successfully run query ($sqlS) from DB: ".mysql_error();
exit;
}

while($row = mysql_fetch_assoc($resS))
{
echo $row["Year_Name"]."<br>";
}

ladjack
May 26th, 2008, 09:23 PM
Clean reinstallation just helps.