RE: [PHP] Re: mysql statement (still a semi newbie)
Tim's right about NULL. You can either specify what exactly are the fields of the row you want to update/insert using SET before VALUE (seek the manual at www.mysql.com for more info) or you can just write NULL (without any quotes) where the fields are automatic like *auto_increment* or like *timestamp*. I would suggest that you read more about syntax before you go on, and to place this kind of questions to the PHP Database list to get proper help. It is also a good idea for you to subscribe to the MySQL lists which are very crowded with MySQL gurus. HTH, C. -Original Message- From: Tim Stoop [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 6:00 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: mysql statement (still a semi newbie) Alexander Ross wrote: That first column is an auto_incrementing column so i don't want any data INSERT INTO cast VALUES(DEFAULT, 'Rick', 'Blaine', 'Humphrey', 'Bogart', 'male'); I think you need to use NULL instead of DEFAULT... I'm not 100% sure. Just try it :) -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql statement (still a semi newbie)
I'm always making my inserts like this: $Insert = INSERT INTO basket_db (name, image_id, customer_id, session_id) ; $Insert .= VALUES ('$name', '$image_id', '$customer_id', '$PHPSESSID'); ...and I'm using the SET Field = '$Value' in the Update Querys like this: $UpdateQuery = UPDATE produkt ; $UpdateQuery .= SET produkt_name = '$produkt_name', ; $UpdateQuery .= size = '$size', kategorie = '$kategorie' ; $UpdateQuery .= WHERE produkt_key = '$produkt_key'; hope it helps someone out ;o) Schura - Original Message - From: Tim Stoop [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 14, 2002 11:00 PM Subject: [PHP] Re: mysql statement (still a semi newbie) Alexander Ross wrote: That first column is an auto_incrementing column so i don't want any data INSERT INTO cast VALUES(DEFAULT, 'Rick', 'Blaine', 'Humphrey', 'Bogart', 'male'); I think you need to use NULL instead of DEFAULT... I'm not 100% sure. Just try it :) -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php