views:

44

answers:

2

I am messing around with one of my databases.. is there away for me to search for a string in ALL the tables.. and replace it with another everywhere it occurs?

I am looking for SQL

+2  A: 

You need to use MySQL's Prepared Statements to do this, because first you need a list of tables by querying INFORMATION_SCHEMA. This list is string data types, which you can not immediately use as the FROM clause in subsequent queries.

OMG Ponies
ok so you are speaking french.. i know how to go around mysql and mess with stuff, but i know nothing about sqli found the code to replace the string in a certain table in a certain field or whatever.. but i am looking to replace it everywhere with one statement :/
Shonna
+1  A: 

There is no immediate SQL to do this, databases are not flat text files.

If you are trying to learn something follow OMG Ponies advice.

Alternatively, searching google for terms: mysql search and replace all tables gives as a first result on a first page a helpful discussion.

Unreason