Replace sql field using PHP

Soldato
Joined
16 Oct 2007
Posts
7,429
Location
UK
Can anyone help? I'm trying to use a script to replace a database value

PHP:
UPDATE data SET field = replace(MMSI,'235095793','Britannia');

Is what I have at the moment.
In the table 'data', I want to replace the value '235095793' with 'Britannia' from the column 'MMSI'

But it gives me a

Parse error: syntax error, unexpected T_STRING in /home/mission/public_html/ais/import.php on line 97

Any ideas? Thank you
 
Caporegime
Joined
28 Jan 2003
Posts
39,876
Location
England
I spent three hours one morning tearing my hair out as to why something wasn't working, turns out I'd been viewing a duplicate of the local site and not the page I was updating.

:o
 
Back
Top Bottom