Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql UPDATE syntax...

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hello !

I am having a problem since a few days, and I've decided it's time for me to ask for some help.

On a page, I display all the records from a Database (from 1 to 300) inside text fields ( name=\"ID\" ) generated by a PHP loop.
Then, each textfield has a different name and it's apropriate data/value.
I want to multiply all those record by 110 for example and at the same time, I would like to make it possible to update all the records of the concerned column.
Right now, the code I used updates all the records with the last field's value. The result is that all the records get the same value/data.
That's too bad!!!!
Thanks alot for the one who will take the time to answer the question.

 
with in your loop that does your multiplying you are going to have to update the record right away before it goes on to the next record. That should work.
 
Hello Thumbelina!

Thanks for your quick response.
I've already tried to do what you advised, but I noticed
the page was very slow to load. I think the reason is that the script opens, writes and close the database for each record. Are you sure it is a good thing to do? (it's just a question =>I'm a sort of beginner...).
Also, the result wasn't the result expected.
Again all the records got the same value.
Anyway, if you are sure your solution is the BEST, I will revise what I've done quickly.
Thanks again anyway!!!
Bye.
 
I'm not sure my solution is the best. It was just the best suggestion I could give based on what you asked. I'm afraid that I'm not an expert either, but you know you might get better help if you put this question in the php fourm, cause i think your problem is with the php code not with your mysql commands. also try posting some code, might help other people to see the problem with it easier, doing that has helped me find better answers. good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top