nanie Posted September 12, 2013 Share Posted September 12, 2013 Hi, I don't know how to solve this problem. Please help me. <?php if(isset($_COOKIE['ID_site']) && isset($_COOKIE['Pass_site'])) { $_SESSION['id'] = $_COOKIE['ID_site']; $_SESSION['password'] = $_COOKIE['Pass_site']; if(isset($_SESSION['id'])) { $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 else { ? Quote Link to comment https://forums.phpfreaks.com/topic/282085-warning-oci_fetch_array-expects-parameter-1-to-be-resource-string-given/ Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2013 Share Posted September 12, 2013 you missed the $ off of query2 in the parameter list of oci_fetch(). You should have also got an "Undefined constant" warning as well. Quote Link to comment https://forums.phpfreaks.com/topic/282085-warning-oci_fetch_array-expects-parameter-1-to-be-resource-string-given/#findComment-1449241 Share on other sites More sharing options...
Solution nanie Posted September 13, 2013 Author Solution Share Posted September 13, 2013 Thank you Muddy Funster for noticing it. I feel ashamed that I can't notice it. Quote Link to comment https://forums.phpfreaks.com/topic/282085-warning-oci_fetch_array-expects-parameter-1-to-be-resource-string-given/#findComment-1449314 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.