![]() |
|
| |||||||
| Notices |
| mySQL & PHP Discussions, information and help with mySQL and PHP. |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| Hey guys, I have a code here that works fine, the problem is i want to update more than 1 field. PHP Code: PHP Code: Matt |
|
#4
| ||||
| ||||
| You got no help because no help can be offered. There is no way to batch update a database, at least to my knowledge. You can only create a loop that will repeat the same operation as many times as required.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#6
| ||||
| ||||
| The loop depends on the logic, but there i can't see the logic in the loop you posted. The loop depends on what you need to to. If you can explain the logic, we will be able to help.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#7
| ||||
| ||||
| All that while loop is checking for is if $query = something... which since you are using a string that stays constant its always going to be assigned at the very least "UPDATE SET WHERE username='$username'" Now what you need to do is count how many elements are in the array using the count() function. Then just use a for loop (or while loop if you wanted) and go through each element of the array one by one until you have gone through it count() times. PHP Code: PHP Code:
__________________ Freelance web programming Do you need help installing a script, or need one written for you? I do freelance web programming (XHTML, CSS, PHP, MySQL). Feel free to contact me through my website and I will get back to you with a quote asap. Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |