I have been running MAMP Pro (1.9.6.1) on a 2011 MacBook Pro for the last three years. PHP 5.2.17 / MySQL 5.5.9
I wrote a .php-driven site to store info about my radio show. It has run without any problems or any errors.
I have upgraded to a new MacBook Pro running MAMP Pro 3.0.7.3 - PHP 5.6.2 / MySQL 5.5.38. The scripts that were running solidly, without error, in the first set up are producing unexpected results in the second set-up.
I am 90% certain that this is due to how either .php or MySQL are handling single quotes / apostrophes in my new set up.
INSERT queries that feature '
characters aren't being successfully inserted into the database.
e.g
INSERT INTO song_info
(artist_id, title_id, composer_id, publisher_id, album_id,
album_track, label_id, cat_no, format, howsent, song_rating,
duration, intro, fade, year, medium, release_date, recommended,
cymraeg)
VALUES
('2', '2', '2', '2', '2', '99', '2', 'voom001', 'album_track',
'direct', '6', '3'01', '0'36', '2'50', '2015', 'vinyl',
'2015-03-19', '0', '0')
The queries execute successfully if there are no '
characters within the values I want to insert into the database.
The queries with ' characters in the values I want to insert into the database execute successfully on the previous set-up.
The scripts are exactly the same.
I don't want to start changing the scripts - escaping the '
characters within the .php - because I'm pretty sure this is a config issue, I just don't know where / what to change.
These scripts run locally on the laptop. They're not accessible to anyone else, nor will they be.
So although I'm aware there are real security issues inherent in coding like this, I'll address those when I upgrade the (thousands of lines of) code in due course.
I need to quick temporary fix so that I can complete my work. Then I'll begin work on upgrading the code properly.
I'm using the mysql_ functions. Again, will upgrade to mysqli_ when I have an opportunity to do so.