/    Sign up×
Community /Pin to ProfileBookmark

Empty Query: How?

Hi, Everybody!

How do I know when a query returns “empty.” I echoed the results and I found out that they aren’t empty, but regarless of whether it’s empty or not the out is always the same. In other words, I can’t use an if statement.

Can anybody help me out with it, please? I am new at SQL/PHP. What I am trying to do is get some kind of value of either 0 or 1, that I can use to display a message page when the record isn’t found, instead of a blank page.

Thanks a lot before hand.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@toenailsinJun 09.2009 — use mysql_num_rows() to see how many rows were returned
Copy linkTweet thisAlerts:
@jsbertauthorJun 10.2009 — Wow!!! Is that all?? Thank you much! I am going to try it right away!
×

Success!

Help @jsbert 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.4,
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,
)...