i have this code:
$dbconn = pg_connect("host=localhost dbname=dbbase user=postgres password=postgres") or die('Connection error: ' . pg_last_error());
$qstation ="SELECT id FROM st WHERE string ='".$string."'";
$rstation = pg_query($dbconn,$qstation) or die('Query error: ' . pg_last_error());
echo $qstation;
this shows me
SELECT id FROM st WHERE string='A_AA_00_00_A'
if i execute it on pgadmin3, it returns me the result.
but if i try to do
print_r(pg_fetch_array($rstation, null, PGSQL_ASSOC));
i have no erros and print_r() does not return me anything.
if i change the $string variable with 'A_AA_00_00_A'
$qstation ="SELECT id FROM st WHERE string='A_AA_00_00_A'";
the sentence executes right and print_r() returns data
Array ( [id] => 10 )
what am i doing wrong?