RE: [PHP-DB] Huw do I perform update? I missed the accual code bi t.. sorry
| From: | Ricky Theil | Date: | Wed, 26 Sep 2001 18:55:15 +0000 |
| Subject: | RE: [PHP-DB] Huw do I perform update? I missed the accual code bi t.. sorry | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12748@lists.php.net to get a copy of this message | ||
I have no problem updating integer and float fields when putting them in ''
if you update an integer with a blank value, it makes the value in the db
=0. always on unix and mysql, though.
Ricky
-----Original Message-----
From: Brian Paulson [mailto:info@chieftain.com]
Sent: Wednesday, September 26, 2001 11:41 AM
To: 'Rick Emery'; php-db@lists.php.net
Subject: RE: [PHP-DB] Huw do I perform update? I missed the accual code
bit.. sorry
Id news_id an integer?
$query = "UPDATE dvd.news_categories SET
newscategory='$newscategory',
newscat_status='$newscat_status' WHERE newscat_id='$newsid'";
^ if this is an
integer in the datebase then it wont update proproly.
Should look like this
$query = "UPDATE dvd.news_categories SET
newscategory='$newscategory',
newscat_status='$newscat_status' WHERE newscat_id = $newsid";
Hope this helps
Thank You
Brian Paulson
Sr. Web Developer
The Pueblo Chieftain Online
bpaulson@chieftain.com
http://www.chieftain.com
> -----Original Message-----
> From: Rick Emery [mailto:remery@excel.com]
> Sent: Wednesday, September 26, 2001 10:59 AM
> To: php-db@lists.php.net
> Subject: RE: [PHP-DB] Huw do I perform update? I missed the
> accual code bit.. sorry
>
>
> What does table look like?
> What does preceding code look like?
> What error message are you getting?
>
> Try printing the value of $query. What does it look like?
> Copy/paste that into mysql directly; what error do you get?
>
> -----Original Message-----
> From: Tommy Nilsson [mailto:tommyhome@softhome.net]
> Sent: Wednesday, September 26, 2001 11:14 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Huw do I perform update? I missed the
> accual code bit.. sorry
>
>
> Sorry,:
> This is my query:
> $query = "UPDATE dvd.news_categories SET
> newscategory='$newscategory',
> newscat_status='$newscat_status' WHERE newscat_id='$newsid'";
>
> but it doesn't seem to work.
>
> help anyone?
>
> //Tommy
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net