Jump to content

Search and replace in full mysql database with php


nadz

Recommended Posts

im trying to add an option which allows the user to change their username. Usernames appear in my database in a number of tables under several fields. i thought rather than using UPDATE queries for each field there might be a query that allows me to update all cells in the db where for example the value is "user124".

 

i found this article but im not entirely sure how to use it in php:

 

http://vyaskn.tripod.com/sql_server_search_and_replace.htm

im using phpmyadmin if that makes it easier? any help would be appreciated

Link to comment
Share on other sites

Usernames appear in my database in a number of tables under a several fields.

 

Sorry, but that wreaks of poor design right away. You shouldn't ever need to duplicate data.

 

i found this article but im not entirely sure how to use it in php:

 

The article you found is for MSSQL server, not MySql. There really is no easy way to acieve what you want.

Link to comment
Share on other sites

hmmm, i didnt write the script, i know its terrible coding but the script does look and function nicely. i actually paid $300 for it and this is the only issue i have with it at the moment. Anyway, if there isnt a way to search the whole database is there any way to search at least a full table?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.