Re: General Question!
| From: | Alireza Balouch | Date: | Mon, 05 Apr 2004 08:29:41 +0000 |
| Subject: | Re: General Question! | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33749@lists.php.net to get a copy of this message | ||
¨First of all you must NOT use the inputs right from the field and put it in
your sql.
use trim first for secuety ...
ok if you have a several fields with the same name (although wrong way to
do it! ) , you can use the
print_r($_POST); function to see what you get out of it.... or else the
last input wil be posted (I think)
Hope this helped.
:)
"Jerry" <jusa_98@yahoo.com> wrote in message
news:20040405043713.8209.qmail@web41206.mail.yahoo.com...
> If I have a form that has in a text field something
> like this below how would my query look to update all
> in the form to the fb?
>
> <input type=text name=username> <input type=text
> name=total>
>
> So there is data inputed in username field and total.
> Now let's say there is 5 of these text fields for the
> one form. All named the same (e.g. username and
> total) but in each area the user puts something
> different.
>
> so if I have
>
> UPDATE tbl score='$total' WHERE username='$username';
>
> (quick work only so you know what I mean)
>
> But that will ONLY update one part of the form rather
> than all text areas to the db. How can I get each one
> to input? Keeping in mind each line of text area has
> the same form name as the previous. Is there a way
> around this so everything is updated correctly instead
> of bits here and there?
>
> Cheers!
>
> Find local movie times and trailers on Yahoo! Movies.
> http://au.movies.yahoo.com