Hi 

Thanks to CC Zona and Dean for their help

It all made sense this morning (BST).

I echoed the query and lo and behold... errors ... and of course I could see
where the problems lay.

It's amazing what a good nights sleep will do!

thanks again

now does anyone know about getting ages from dates of birth (previous post
of mine) and also searching by age group when you only have dates of birth
in the table!!

cheers
matt


t  h  r  e  e  z  e  r  o     :       :      :

the mill, millstone lane, leicester, le1 5jn
e : [EMAIL PROTECTED] ::  m : 07747 845690
w : http://www.threezero.co.uk

:       :      :    t  h  r  e  e  z  e  r  o


> From: CC Zona <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Sun, 25 Mar 2001 10:39:23 -0800
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] newbie help
> 
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Matt Coyne) wrote:
> 
>> I have been trying to detect if the variable holds any value and then
>> building a query by concatenating like this:
> 
> if(!empty($foo))
>  {
>  ...
>  }
> 
>> $result=@mysql_query($concatsql, $connection) or die ("bugger...!");
>> 
>> This just dies on mysql_query.
> 
> $result=@mysql_query($concatsql, $connection) or die (mysql_error() . "
> from query <br>\n$concatsql"); //show as much relevant info as possible
> 
> When building complex queries like this, it's really easy to miss a missing
> quote or extra comma, etc.  Displaying the query string usually makes it
> quite obvious where the problem lies (especially when coupled with a MySQL
> error message, since MySQL is pretty good about pointing out the spot where
> the syntax fails).
> 
> -- 
> CC
> 
> -- 
> PHP Database 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]
> 
> 


-- 
PHP Database 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