Jump to content


Photo

Fastest way to edit database content?


  • Please log in to reply
2 replies to this topic

#1 t.bo

t.bo
  • Members
  • PipPipPip
  • Advanced Member
  • 57 posts

Posted 21 July 2006 - 09:12 AM

Hello everybody,

I have a lot of text and links set in my database. Now i've seen that there's an error in all the links and all the same error. I need to edit them but if im gonna edit every link seperatly its gonna take me a lot of time.

How can i edit database content really fast. I need something like the Find and replace function in dreamweaver.

Could I enter phpmyadmin and use update tablename SET ...    ?
The links are not in a separate field but together with text in one big content field.
Greetz and thanks in advance

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 21 July 2006 - 09:21 AM

UPDATE tablename SET colname = 'newval' WHERE colname = 'oldval'
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 21 July 2006 - 09:33 AM

If you just want to change part of a column's value,
$srch = 'my.domain.com';
$rplc = 'your.domain.com';
$sql = "UPDATE tablename SET colname = REPLACE(colname, '$srch', '$rplc')";

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users