/    Sign up×
Community /Pin to ProfileBookmark

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

Please help me to solve this problem. I couldn’t understand the error. I read related article, but they show about boolean error, mine is string. Why is that happen? Pleaseee help me..?

[code=php]<?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’];

$query2 = oci_parse($conn,”SELECT * FROM user1 WHERE id ='”.$id.”‘”)or die(oci_error());
$check2 = oci_execute($query2);

while($info2=oci_fetch_array(query2,OCI_ASSOC+OCI_RETURN_NULLS)) //the error is from this line
{
//if the cookie has the wrong password, they are taken to the login page
if (($pass != $info2[‘PASSWORD’]) || ($info2[‘ROLE’] != ‘admin’) )
{
header(‘Location: 1.php?error=4’);
}
//otherwise they are show the admin home
else
{

?>[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 12.2013 — <i>
</i>while($info2=oci_fetch_array([COLOR="#FF0000"][B]$check2[/B][/COLOR], OCI_ASSOC+OCI_RETURN_NULLS))
Copy linkTweet thisAlerts:
@nanieauthorSep 12.2013 — OMG, I made a huge mistake. How can I not notice that I just missing the $ sign all this while?

while($info2=oci_fetch_array($check2, OCI_ASSOC+OCI_RETURN_NULLS))


admin pls remove this post. I'm too ashamed. ?
Copy linkTweet thisAlerts:
@NogDogSep 12.2013 — We all tend to look for complicated reasons instead of the simple reasons when we get an error. It won't be the last time it happens to you. ?
×

Success!

Help @nanie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...