Hi NG,
I wonder if anyone has encountered any problems with values returned from an
Oracle SQL query, more specifically when the result set is empty? I have
the following code:
$sql = "SELECT \"irpUser\" FROM tblUsers WHERE
\"swmEmail\"='{$_POST['swmEmail']}'";
$sth = ociparse ($conn, $sql)
or die ("Couldn't parse SQL: $sql<br>\n");
ociexecute ($sth)
or die ("Couldn't execute SQL: $sql<br>\n");
ocifetchinto ($sth, $usr, OCI_ASSOC);
if ($usr['irpUser'] == "")
{
// Do stuff here
}
else
{
//Something else
}
Now, when the query brings back a record everything works fine, but when the
query returns nothing (i.e. brand new user) it still goes to the else branch
of the code. I have echo'ed $usr to the screen and it contains the string
"SYSTEM". Now as far as my code goes I don;t think this is too much of a
problem as I can just check for this string (normal values are integer), but
I can find no reference to this behaviour in the docs and would like to know
what is causing this return value. Any ideas?
Mikey
---
Developer - Radius Design Ltd.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php