0

hi everyone i need help in my query while user login.

<?php

$username = $_POST["username"];
$password = $_POST["password"];

$con = oci_connect("user","pswrd","db");
if(! $con)
{
    die('Connection Failed'.oci_error());
}
$query = "SELECT username, password FROM users
WHERE username=$username";

$stmt = oci_parse($conn, $query);

$row = oci_fetch_array($stmt, OCI_NUM);;

if($row["username"]==$username && $row["password"]==$password)
    echo"You are a validated user.";
else
    echo"Sorry, your credentials are not valid, Please try again.";
?>

i got error which is that
oci_fetch_array(): ORA-24374: define not done before fetch or execute

2
Contributors
5
Replies
22
Views
2 Weeks
Discussion Span
Last Post by rproffitt
0

kindly guide me in my code why its not working?

Edited by NA

0

no sir explain in which line i need to change to a perfect code

0

Sorry, I've yet to see perfect code. But I did try to share why your system is broken in both a missing line plus why it's a bad idea to store passwords.

I can only guess you didn't check the example in the PHP document link I shared.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.