Hi;
I want to move an entry from tableA to tableB.
Both tables are identical and have 20 fields.
At the moving process, i will change the value of just one field.
What is the wisest way to do this?
Can you suggest a way with procesing one query?
moving entries....
Moderator: General Moderators
yes this is nice, but
i just want to move just one row, so while is unnecassary,
and both tables have 20 fields. So
the get variables part is a little bit long.
The method is that, creating an insert statement using 20 variables from the first table.
Then executing the query. However this does not look well.
Yeah, it is working, but i thought there should be a better way.
Thnx for the help
i just want to move just one row, so while is unnecassary,
and both tables have 20 fields. So
the get variables part is a little bit long.
The method is that, creating an insert statement using 20 variables from the first table.
Then executing the query. However this does not look well.
Yeah, it is working, but i thought there should be a better way.
Thnx for the help
Sorry, I misunderstood the question.
Is this something that you are going to do on a regular basis? or a one time thing.
You could do it through PHPMyAdmin if you have access to that and export the table (and data), take the one row of information, then add it to the new table.
That's if you don't have to do it often.
Is this something that you are going to do on a regular basis? or a one time thing.
You could do it through PHPMyAdmin if you have access to that and export the table (and data), take the one row of information, then add it to the new table.
That's if you don't have to do it often.
Needless to say sorry 
In fact, this is a one time thing.
So, it is not an essential part of the project
But i always want to write my codes smart enough, and just writing all fields does not seem smart.
As you point, we can take information from one table (field by field) and then, dumping them to another table. That will work
But in this type of soulution, you have an SQL-statement like that :
INSERT INTO tbname (field1,field2,.....,field20) VALUES (value1, value2,.....,value20)
where fields are identical at both tables, and the values mined from first table.
However, it is a little bit long statement i think. Instead,
1)getting table fields information,
2)assigning them to an array,
3)creating and sql statement using "foreach (or other loop functions)"
4)quering it to mySQL.
What say you, is it logical?
Thnx for help.
Kind Regards.
In fact, this is a one time thing.
So, it is not an essential part of the project
As you point, we can take information from one table (field by field) and then, dumping them to another table. That will work
But in this type of soulution, you have an SQL-statement like that :
INSERT INTO tbname (field1,field2,.....,field20) VALUES (value1, value2,.....,value20)
where fields are identical at both tables, and the values mined from first table.
However, it is a little bit long statement i think. Instead,
1)getting table fields information,
2)assigning them to an array,
3)creating and sql statement using "foreach (or other loop functions)"
4)quering it to mySQL.
What say you, is it logical?
Thnx for help.
Kind Regards.