/    Sign up×
Community /Pin to ProfileBookmark

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean.. HELP pls..

hey guys, i’m just a newbie in php..
i have just started learning and i’m confused.
i know my query is correct but i dont know why i’m getting this error at all..
??
here’s the code..
[ATTACH]15295[/ATTACH]

here’s the error message:
[ATTACH]15297[/ATTACH]

tnx in advance.?

[canned-message]attachments-removed-during-migration[/canned-message]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 05.2013 — What that means at least 99% of the time is that your call to mysql_query() failed for some reason, so it returned a Boolean false instead of a query result resource. A quick and dirty way to debug it:
[code=php]
$sql = "SELECT * FROM some_table";
$result = mysql_query($sql);
if($result == false) {
die("<pre>Query failed:n".mysql_error()."n".$sql."</pre>");
}
[/code]


PS: If possible, you really should move on up to the MySQL[b]i[/b] extension in PHP, as the old MySQL extension is considered to be deprecated, and as such may not be supported by future versions of PHP.
×

Success!

Help @yvaine 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 4.30,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...