Jump to content

Warning: oci_fetch_array() expects parameter 1 to be resource, string given


Recommended Posts

Hi, I don't know how to solve this problem. Please help me. :confused:


if(isset($_COOKIE['ID_site']) && isset($_COOKIE['Pass_site']))
      $_SESSION['id'] = $_COOKIE['ID_site'];
      $_SESSION['password'] = $_COOKIE['Pass_site'];
 		$id = $_SESSION['id'];
 		$pass = $_SESSION['password'];
        echo $id;
    	$query2 = oci_parse($conn,"SELECT * FROM user1 WHERE id ='".$id."'")or die(oci_error());
		$check2 = oci_execute($query2);
	    echo $check2;
 		while($info2=oci_fetch_array(query2,OCI_ASSOC+OCI_RETURN_NULLS)) //the error come from this line
			echo $info2[0];
        //if the cookie has the wrong password, they are taken to the login page
 		if (($pass != $info2['PASSWORD']) || ($info2['ROLE'] != 'admin') )
                  header('Location: index.php?error=4');
         //otherwise they are show the admin home
Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • 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.