Re: Assigning a Value (Re-Explained)
| From: | Frappy John | Date: | Sun, 13 Apr 2003 23:21:24 +0000 |
| Subject: | Re: Assigning a Value (Re-Explained) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143697@lists.php.net to get a copy of this message | ||
> In the form if the person types in "yes" for the
> completed field, I need PHP to convert yes to a "1" else
> it will convert it to a "0"
Pretty hairy logic. See:
http://www.php.net/manual/en/control-structures.php#control-structures.if
> the table that uses the numbering system keeps track of
> the completed tasks. so this number will increase from
> time to time.
So you appear to be saying that this second table has only a single record with a single column. If
so:
update completedtask table set completedTaskCount = completedTaskCount + 1;
--Frappy
On Sunday 13 April 2003 06:14 pm, Hunter, Jess wrote:
> In my previous post I think I explained my situation
> improperly, so let me try it again
>
> I have a multi-table database, I have a form that creates
> a new record for one table yet updates a record in
> another table.
>
> In the form if the person types in "yes" for the
> completed field, I need PHP to convert yes to a "1" else
> it will convert it to a "0"
>
> the table that uses the numbering system keeps track of
> the completed tasks. so this number will increase from
> time to time.
>
> Here is what I am looking at doing when a person enter in
> the word "yes"
>
>
> $addcompleted=$Row[total_completed]+$Array[completed_toda
>y]
>
>
> Then in the Update portion of the script have:
> ..... SET total_completed='$addcompleted' WHERE
> ..........
>
>
>
> any help and explanation would be greatly appreciated, I
> guess I just don't understand the How and Why of the
> function
>
>
> Thanks,
>
> jess