Jump to content

php oracle select statement help


paintbawler1

Recommended Posts

so here is my "simple" select in code that I want to work with my Oracle DB.

 

<?php
session_start();
$userid = trim($_POST['userid']);
$logPassword = trim($_POST['password']);
require("includes/dbconnect.php");
$query = "SELECT * FROM Users";
$query .= " WHERE UserID='$userid' AND Password='$logPassword'";
$statement = oci_parse($conn, $query);
if(oci_execute($statement))
{echo "good execution";}
else { echo "no execution";}
/*if($row = oci_fetch_assoc($statement))
{$SESSION['userid'] = $row['UserID'];
echo "You are a vaild user";}
else
{ echo "You are a invalid user";}
*/	
?>

 

the bottom part is just commented out for now because I keep getting this error:

 

Warning: oci_execute() [function.oci-execute]: ORA-01722: invalid number in /home/greer/public_html/validate_user.php on line 9

 

Line 9 being the oci_execute(). I'm not sure what is causing this error. My select statement seems correct and oci_pasre() came back as true. Anybody see what could be causing the problem. I didn't set up this server so am not sure if that is playing a factor. Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.