/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] mysql_result – general question

Hello:

I have a very general question regarding mysql_result function.

I was reading a PHP/MySQL book and the example code after running a query used this syntax:

$item_price=mysql_result($get_item_res,0,’item_price’);

Can someone tell me how is this different from using: mysql_fetch_array or mysql_fetch_row?

Which method is better and more efficient?

Thank you for your explanations and input.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 16.2007 — mysql_result returns the data from one cell of your table (string) while the other two functions return return an array of cells corresponding to one row of the query result. The former is more resource hungry.
Copy linkTweet thisAlerts:
@focus310authorFeb 16.2007 — Thank you. I think I know what I need to do.
×

Success!

Help @focus310 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.18,
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,
)...