Sorry still struggling on this one.
I've got the script working on my local pack but not on the server. I've cleared the cache and the code is definitely present.
To check I changed the code to echo the query to screen and the output is different on my local pack and the server.
Local pack:
select wordid, notes from words where word = 'it\'s'
select wordid, notes from words where word = 'nine'
select wordid, notes from words where word = 'o\'clock'
Server:
select wordid, notes from words where word = 'it'
select wordid, notes from words where word = 's'
select wordid, notes from words where word = 'nine'
select wordid, notes from words where word = 'o'
select wordid, notes from words where word = 'clock'
As you can see the local pack is escaped whereas the server isn't and "it's" has been split into "it" and "s" and "o'clock" into "o" and "clock"
Is there any reason the regular expression would behave differently on my local pack to on a server?
Code snippets for reference:
$words "it's nine o'clock"
preg_match_all('/\b[a-z\']+\b/i', $words, $matches);
global $videoWords;
$videoWords = $matches[0];
and then
foreach ($videoWords as $resultWord) {
$resultWord = mysqli_real_escape_string($connection, $resultWord);
$doesWordExistAlready = "select wordid, notes from words where word = '$resultWord'";
echo $doesWordExistAlready;
Thanks,
Tim.