Forum Moderators: coopster
My Table has a field called Name which has Names like
Brett Tabke
Bill Gates
Michael Jackson
Bill Clinton
etc. These are sample names :)
This table is added with the new club members every time the above cron is run.
Now I want to write a code such that, when I run that, it modifies the table above, adds a new field called name2, and copies the names from the table name but replaces all spaces with hyphens.
Any help will be appreciated.
Then:
$thisname2 = str_replace(" ","-",$thisname); then insert the second variable (
$thisname2) into the column that's waiting for it. You can easily update all of the existing records by
select id,name from table and then the above replacement then update table set name2 = '$thisname2' where id = '$currentId' (in the looping)