Trying to adjust to moving to php/postgres from php/mysql and trying not to
tear my hair out ;o)
Can someone tell me what I am doing wrong? I tried to do the following with
postgres, and will include the way I normally do it with mysql..maybe someone
can spot what I am missing....
$conn = pg_Connect("host=localhost user=xxx dbname=xxxx");
$result=pg_exec($conn,"select setupflag from m_info;');");
$rows = pg_numrows($result);
for ($i=0; $i < $rows; $i++){
list($setupflag) = pg_fetch_row($result,$i);
echo"$setupflag";
}
does not echo anything for $setupflag
mysql_connect("localhost", "xxxx", "xxxx") or die ("Sorry, couldn't connect to
the database.");
$query = "select setupflag from m_info'";
$result = mysql_db_query('xxx', $query);
while ($r = mysql_fetch_array($result))
$setupflag = $r["setupflag"];
echo"$setupflag";
}
will echo "N" for $setupflag
tear my hair out ;o)
Can someone tell me what I am doing wrong? I tried to do the following with
postgres, and will include the way I normally do it with mysql..maybe someone
can spot what I am missing....
$conn = pg_Connect("host=localhost user=xxx dbname=xxxx");
$result=pg_exec($conn,"select setupflag from m_info;');");
$rows = pg_numrows($result);
for ($i=0; $i < $rows; $i++){
list($setupflag) = pg_fetch_row($result,$i);
echo"$setupflag";
}
does not echo anything for $setupflag
mysql_connect("localhost", "xxxx", "xxxx") or die ("Sorry, couldn't connect to
the database.");
$query = "select setupflag from m_info'";
$result = mysql_db_query('xxx', $query);
while ($r = mysql_fetch_array($result))
$setupflag = $r["setupflag"];
echo"$setupflag";
}
will echo "N" for $setupflag