You didn't really say that in your initial post :-) So, what you mean is
that the db line is not what you actually have in your script? The what
do you really have? Just by looking at the script you posted, the reason
it doesn't work certainly seems to be the invalid database handler. If
you have a function that returns a handler, the syntax would be
something like:

include "connect.inc";
$db = db_connect(); 

This is assuming you have a function called db_connect() that returns a
database handler in your 'connect.inc' file.

Seung-woo Nam

Peter Houchin wrote:
> 
> yes i know it was mearly there to show i had it in my script as i said in my initial 
>post i could get info from the db, just not in the while loop
> 
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 4:08 PM
> To: Peter Houchin
> Cc: Php-General@Lists. Php. Net
> Subject: Re: [PHP] baffled :<:<
> 
> > $db = include"connect.inc";
> 
> includes do not return anything useful, so this is a bogus statement.
> 
> > $foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> >
> >  $result = mysql_query($foo,$db);
> 
> An include certainly cannot return a database handle.  Included files
> operate in the same variable scope as the script doing the inclusion.  So
> simply set $db in your connect.inc file and it will automatically be
> available to you after the include.
> 
> -Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to