RE: insert NULL to mysql table.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Anders,

I don't know the specific answer to the question you pose, but if you echo()
out your db query before you send it to the db, you'll be able to see the
query as it is going to be sent to the db. You can then use your MySQL
syntax knowledge to find the error in the different query strings. I bet
it'll be dead obvious to you if you give that a shot.

Rich

> -----Original Message-----
> From: anders thoresson [mailto:listor@thoresson.net]
> Sent: Wednesday, July 02, 2003 9:30 AM
> To: n.a.morgan@bton.ac.uk
> Cc: php-db@lists.php.net
> Subject: Re:  insert NULL to mysql table.
> 
> 
> > UPDATE un_issue SET i_editor = null WHERE i_date = '$issue'"
> 
>  Thanks. But how come this works and sets i_editor to NULL
> 
>  "UPDATE un_issue SET i_editor = $editor WHERE i_date = \"$issue\""
> 
>  but the following two gives me a sql-error "You have an 
> error in your SQL 
> syntax near 'WHERE i_date = ' at line 1"
> 
>  "UPDATE un_issue SET i_editor = $editor WHERE i_date = '$issue\'"
>  "UPDATE un_issue SET i_editor = $editor WHERE i_date = $issue"
> 
>  and the following sets i_editor to 0, not NULL
> 
>  "UPDATE un_issue SET i_editor = '$editor' WHERE i_date = '$issue'"
> 
>  for all queries $editor = NULL and $issue = 2003-08-15
> 
> -- 
> anders thoresson
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux