nadz Posted August 9, 2007 Share Posted August 9, 2007 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 https://forums.phpfreaks.com/topic/64101-search-and-replace-in-full-mysql-database-with-php/ Share on other sites More sharing options...
trq Posted August 9, 2007 Share Posted August 9, 2007 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 https://forums.phpfreaks.com/topic/64101-search-and-replace-in-full-mysql-database-with-php/#findComment-319444 Share on other sites More sharing options...
nadz Posted August 9, 2007 Author Share Posted August 9, 2007 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 https://forums.phpfreaks.com/topic/64101-search-and-replace-in-full-mysql-database-with-php/#findComment-319447 Share on other sites More sharing options...
trq Posted August 9, 2007 Share Posted August 9, 2007 UPDATE tbl SET uName='new123' WHERE uName = 'user123'; Link to comment https://forums.phpfreaks.com/topic/64101-search-and-replace-in-full-mysql-database-with-php/#findComment-319808 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.