I'm trying to migrate an application from MySQL to Oracle. This used to work before. I'm checking the database for records containing the username (which could only possibly be one, since it's a UNIQUE Primary Key).
I'm doing the OCILogin in a function in an include file. That works fine, or otherwise I would've gotten errors.
I'm getting user not found if the user doesn't exist, and user found! when the user actually exists. However, the formatting of the *update* string (the last printf statement) below, doesn't come out, in other words the while (OCIFetchInto... ) never works/executes. There are no PHP/Oracle errors.
(this is just a snippet of the whole page, but this code is what's causing me grief.
Any ideas?
<?
if ($login) {
empty($result);
empty($resultarray);
$sql = "SELECT * FROM SYS.CUSTOMERDETAILS WHERE UID_SYSTEM = '$uid_system'";
$cursor = OCIParse ($db, $sql);
if ($cursor == false) {
echo OCIError($cursor)."<BR>";
exit;
}
OCIExecute ($cursor);
?>
<p>
<?
OCIFetchInto ($cursor, $checkarray);
if (!isset($checkarray[1])) {
echo ("User not found!<br>");
printf("<a href=http://www.phpbuilder.com/board/archive/index.php/\"newacct_p1.php?uid=%s&pwd=%s\">Register now</a>", $uid_system, $pwd_system);
echo ("<br>or retype your username/password below if you think you typed it wrong");
OCIFreeStatement ($cursor);
} else {
echo ("User found!<br>");
while ( OCIFetchInto ($cursor, $resultarray, OCI_ASSOC) ) {
printf("<a href=\"updateprofile.php?uid=%s\">%s, %s</a>", $resultarray["UID_SYSTEM"], $resultarray["LASTNAME"], $resultarray["FIRSTNAME"]);
}
OCIFreeStatement ($cursor);
}
}
Thanks!
Kind regards,
Henning K. Pedersen
Funcom Oslo AS
I'm doing the OCILogin in a function in an include file. That works fine, or otherwise I would've gotten errors.
I'm getting user not found if the user doesn't exist, and user found! when the user actually exists. However, the formatting of the *update* string (the last printf statement) below, doesn't come out, in other words the while (OCIFetchInto... ) never works/executes. There are no PHP/Oracle errors.
(this is just a snippet of the whole page, but this code is what's causing me grief.
Any ideas?
<?
if ($login) {
empty($result);
empty($resultarray);
$sql = "SELECT * FROM SYS.CUSTOMERDETAILS WHERE UID_SYSTEM = '$uid_system'";
$cursor = OCIParse ($db, $sql);
if ($cursor == false) {
echo OCIError($cursor)."<BR>";
exit;
}
OCIExecute ($cursor);
?>
<p>
<?
OCIFetchInto ($cursor, $checkarray);
if (!isset($checkarray[1])) {
echo ("User not found!<br>");
printf("<a href=http://www.phpbuilder.com/board/archive/index.php/\"newacct_p1.php?uid=%s&pwd=%s\">Register now</a>", $uid_system, $pwd_system);
echo ("<br>or retype your username/password below if you think you typed it wrong");
OCIFreeStatement ($cursor);
} else {
echo ("User found!<br>");
while ( OCIFetchInto ($cursor, $resultarray, OCI_ASSOC) ) {
printf("<a href=\"updateprofile.php?uid=%s\">%s, %s</a>", $resultarray["UID_SYSTEM"], $resultarray["LASTNAME"], $resultarray["FIRSTNAME"]);
}
OCIFreeStatement ($cursor);
}
}
Thanks!
Kind regards,
Henning K. Pedersen
Funcom Oslo AS