[PHP] Re: Query Query

2004-05-30 Thread Khan
The Digital E wrote:
This may be better suited to the MySQL lists, but I'd appreciate it if 
someone could help. I'm probably just missing something stupid here but 
have been coding non-stop for a week and need another set of eyes.

Here's the line of code giving me an issue. I can print all the 
variables in the script to screen and know that they're ok. It returns 
successfully, but fails to update the database. I'm sure I'm about to 
feel pretty stupid, so fire away... just please fire the answer too.

$query=UPDATE $table_name SET company_name='$company', 
first_name='$first_name', last_name='$last_name', address='$address', 
city='$city', state_province='$state', postal_code='$postal', 
office_phone='$office', fax_phone='$fax', email='$email' WHERE 
company_name='$mod_dataset';
you have 'company_name' in SET and then again in WHERE. This looks fishy.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Query Query

2004-05-30 Thread Johan Holst Nielsen
The Digital E wrote:
$query=UPDATE $table_name SET company_name='$company', 
first_name='$first_name', last_name='$last_name', address='$address', 
city='$city', state_province='$state', postal_code='$postal', 
office_phone='$office', fax_phone='$fax', email='$email' WHERE 
company_name='$mod_dataset';
What does mysql_error() says?
Tried to print out the query and execute it directly in the mysql prompt 
or phpmyadmin? What happens then?

--
Johan Holst Nielsen
Freelance PHP Developer
http://phpgeek.dk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Query Query

2004-05-30 Thread Mark Charette
 From: Khan [mailto:[EMAIL PROTECTED]
 you have 'company_name' in SET and then again in WHERE. This looks fishy.

Very common, often required, and perfectly legal.

Mark C.

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