List:General Discussion« Previous MessageNext Message »
From:Lane Johnston Date:January 22 2003 4:31am
Subject:Need the PHP gurus for this one...
View as plain text  

Ok php gurus,
Little info on system: XP, localhost, port 3306
i am tring to connect to a db in mysql and i looks like that I am doing 
something wrong?
Here is the code...

@ $db = mysql_pconnect("localhost:3306", "omegaweb", "jesus316");

if( $db ) { echo "Connected"; }
if( !$db )
   echo "Error: Could not connect to database.  Please try again later.";

$query = "SELECT * FROM books WHERE ".$searchType." LIKE 
$result = mysql_query($query);

$num_results = mysql_num_rows($result); //This is where I am getting the 
error actually: "Warning: mysql_num_rows(): supplied argument is not a valid 
MySQL result resource in c:\inetpub\wwwroot\php testing\results.php on line 

I figured that if $result is NULL then of course there would be an error.

Could someone shed some light on this newbie?

STOP MORE SPAM with the new MSN 8 and get 2 months FREE*

Need the PHP gurus for this one...Lane Johnston22 Jan
  • Re: Need the PHP gurus for this one...Adolfo Bello22 Jan
  • Re: Need the PHP gurus for this one...Jeffrey Powell22 Jan
  • Re: Need the PHP gurus for this one...Jason Brooke22 Jan
RE: Need the PHP gurus for this one...daniel22 Jan