: [PHP-DB] adding integer to field in query
Dillon, John mailto:[EMAIL PROTECTED] wrote on Wednesday, August
13, 2003 10:24 AM:
How do you add a number to a field within the query, ie
without having to
extract? Eg
$query=UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID
Dillon, John mailto:[EMAIL PROTECTED] wrote on Wednesday, August
13, 2003 10:24 AM:
How do you add a number to a field within the query, ie
without having to
extract? Eg
$query=UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID';
is the above visits=(visits+1) legal, cos it doesn't
From: Dillon, John [EMAIL PROTECTED]
Thanks to both responses. In fact, it decided to work once I put 0 in the
cell that 1 was to be added to! It seems it got it started.. 1+NULL=?
1 + NULL = NULL
Any math statement with NULLs in it will equal NULL. (DB wise)
---John Holmes...
--
PHP
How do you add a number to a field within the query, ie without having to
extract? Eg
$query=UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID';
is the above visits=(visits+1) legal, cos it doesn't work at the moment?
Thanks,
John