This does not work
$query = "SELECT * FROM time-lords WHERE user='thedoctor'";
I get this error:
Warning: pg_query(): Query failed: ERROR: syntax error at or near "-"
This one does work
$query = "SELECT * FROM time_lords WHERE user='thedoctor'";
So I suppose the issue is the hyphen. What is the correct way to write this? I've tried wrapping the column name in just about everything....."time-lords", [time-lords], `time-lords` and nothing seems to work.
Thanks! That solved the syntax error. To get the query to filter I had to do the escape double quote on the column as well:
$query = "SELECT * FROM \"time-lords\" WHERE \"user\"='thedoctor'";