Board index   FAQ   Search  
Register  Login
Board index php forum :: Database phpMyAdmin

Tough Qurry help

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: macek, egami, gesf

Tough Qurry help

Postby Michael_D » Mon Sep 30, 2002 8:08 am

A little background might help here.
I have two tables one called final has 9000 entries, 9 colums, with one colum, "C" Containing some old data.
The new table final1 has 3000 entries, two rows "I" (Old Data) and "J" (New Data) . Since not all of the codes in the old table "Final" need to be replaced, only 3000 of them, And the new script has the 3000 that need to be replaced, I fuigured there has to be a way of querrying the two tables to Replace the old code with the new code if "C" found the old code it was equal to in "I"
I would like to change "final" where row C = "final1" colum I and replace that data with "final1" colum J
Hope that makes scense. This is bugging me.
Thanks everyone!
Michael
Michael_D
 

Postby Jay » Mon Sep 30, 2002 11:04 am

So let me make some sense of this:
You have a table, which contains information you want to change. The changes to be made are in a second table. You will cross reference the rows to change by values in the second table, and change it for another value which is in the second table?

If this is the case, just use PHP. What you want to do is select I and J from table1, and while it lists I and J, you want to search for a record containing I in column C, and change it to J (update final set c='J' where c='I').

Once it finishes the loop all should be done
Jay
 


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.