I'm using php4.1.1 on Linux...
I have the following string...
$sql = "select table.id, table.user, table.pass, FROM table, WHERE table.id='1234' AND table.user='lee' AND ORDER BY table.id DESC";
This is being automatically generated based on the amount of arguments passed to the script (which explains the superflous ,'s and ANDs). So, I'm using ereg_replace to remove them like so:
$sql = ereg_replace(', FROM', ' FROM', $sql);
$sql = ereg_replace(', WHERE', ' WHERE', $sql);
$sql = ereg_replace('AND ORDER', 'ORDER', $sql);
However, this doesn't actually DO anything to $sql - is this function simply not working? or do I have the syntax wrong? (is it something to do with the comma in the pattern?)
Thanks...