PostgresSQL production table database has capital letter

40 Views Asked by At

may I know how can I select my database if all the column has all capital letters. I run this query and it works

SELECT public.countryhomes."PH" from public.countryhomes where public.countryhomes."Read_Datetime" = '2022-09-21 10:15:00'

However when I tried to put inside my PHP code it doesn't work. I run like this

$sqlx = pg_query($dbconn, 'SELECT public.countryhomes."PH" from public.countryhomes where public.countryhomes."Read_Datetime"  = '.$date.'');

When I tried to echo the sqlx, it returned with error saying syntax error near the quot and return something like this

SELECT public.countryhomes."PH" from public.countryhomes where public.countryhomes."Read_Datetime"  = 2022-09-21 10:15:00

means, it didnt read my quotes near the datetime. Does anyone know how to fix this? Because I am not allowed to change the database since its in production. Please help

0

There are 0 best solutions below