Re: Query help needed

From: Date: Thu, 29 Nov 2001 14:56:16 +0000
Subject: Re: Query help needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-76041@lists.php.net to get a copy of this message
It looks OK, but I have lousy track record of writing out "perfect" sql which doesn't work. Syntax looks OK. 1. What does it look like if you write out the update statement, assign it to a var and then echo the var? 2. Can you try it at the console? 3. Try " or die(mysql_error) ;" to see if you get a more specific error 4. Are your date and time fields of type char in the database? Yo may not need the surrounding single quotes. 5. Try building the sucker up bit by bit, until you hit where it breaks. Miles At 11:31 AM 11/29/2001 +0000, Payzillee wrote:
Hi, could anyone tell me what is wrong with this Insert query? I get an 'Invalid query' error but I can't see the problem at all. All the fields match exactly what is in my database, it's all in lowercase too. Cheers. mysql_query ("INSERT INTO listserve (title, surname, forename, job_title, org_name, address1, address2, address3, address4, city, region, postal_code, country, email, mob_phone, tel_number, fax_number, org_web_address, personal_web_address, special_interests, date, time) VALUES ('$title', '$surname', '$forename', '$job_title', '$org_name', '$address1', '$address2', '$address3', '$address4', '$city', '$region', '$postal_code', '$country', '$email', '$mob_phone', '$tel_number', '$fax_number', '$org_web_address', '$personal_web_address', '$special_interests', '$date','$time')") -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#76041) next »