Another mysql_fetch_array() error....
Posted: Wed Jan 01, 2003 4:18 am
I am getting an error on line 24 in the following code, click the link and you wll see all the code but in formatted PEAR standard, and line numbers. The error is displayed at the top of the page.
The url is here: http://nopaste.php-q.net/2633
Just incase your peeping eyes done see the error message it is;
Edit: It seems that i have just got passed, this error becuase i had no connection to the database, so the following code must be wrong?
I have my displaying tabeles, but nothing is being drawn from the database/tables.
I would then include this page with functions, in my main page then just type mysqlconnect(); but this did not work for an unknown reason. I decided to connect normally i got no error message but no displaying data.
Thanks...
Aza........
?>
The url is here: http://nopaste.php-q.net/2633
Just incase your peeping eyes done see the error message it is;
I previosly asked someone about this problem and he said to add an extra '=' on line 24 to make it '==' I gave it a shot, and it put it in a continues loop and made the site extremely slow also giving the error. He also insisted i used an extra '$' with the varibles, doubling the dollar, but i just got another error. Please help, i will be most greatfull and appreciate your expertise.Source: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\forum 2\functions.php on line 24
Edit: It seems that i have just got passed, this error becuase i had no connection to the database, so the following code must be wrong?
Code: Select all
<?php
function mysqlconnect()
{
global $link;
$link = mysql_connect($serv , $user , $pass);
if ( ! $link )
die ( "Couldn't connect to MySQL" );
mysql_select_db( $data , $link );
}
?>I would then include this page with functions, in my main page then just type mysqlconnect(); but this did not work for an unknown reason. I decided to connect normally i got no error message but no displaying data.
Thanks...
Aza........
?>