[PHP-DB] Re: General Question!
> name=total> You have to chainge this into: > UPDATE tbl score='$total' WHERE username='$username'; Then you have to chainge the query to something like this: for ($a = 0; $a <= count($username) -1; $a++){ $query = UPDATE tbl score='$total[$a]' WHERE username='$username[$a]; mysql_query($query) or die (Error message of your own, or something like that); } I hope this works Maurice -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: General Question!
¨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" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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? > > 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php