It's all in the title really.
I've got this SQL query, ugly I know, but it should at least work... It works when I use it in PHPMyAdmin but when sent from PHP I get a syntax error from MySQL. :(
INSERT INTO `shortname_revisions` (old_shortname , new_shortname) VALUES ('$old', '$new');
UPDATE `soft_data` SET shortname = REPLACE(shortname ,'$old', '$new');
UPDATE `shot_data` SET shortname = REPLACE(shortname ,'$old', '$new');
UPDATE `virus_scanning` SET shortname = REPLACE(shortname ,'$old', '$new');
UPDATE `lang_translations` SET shortname = REPLACE(shortname ,'$old', '$new');
UPDATE `ratings` SET shortname = REPLACE(shortname ,'$old', '$new');
UPDATE `file_data` SET shortname = REPLACE(shortname ,'$old', '$new');
The $new
and $old
variables when pasted into PHPMyAdmin to test, would contain any string. Use $old = "media-player"; $new = "video-player";
as examples.
Also, I'm not sure of the correct use of the back ticks and where they should be and when, maybe that's part the problem.
For everyone asking about the error, sorry, I didn't post it. And I sure ain't about to go and recreate the error to paste it here. It was a pretty generic "You have a syntax error in roughly this square quarter mile of code somewhere" error.