Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
mysql_num_rows issue.
Old 09-03-2008, 09:52 PM mysql_num_rows issue.
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
PHP Code:
$query " SELECT *
FROM `member`
ORDER BY `id` DESC"
;
$recs_per_page 6//2 records will be shown per page
              
              
$no_recs mysql_num_rows($query) or die(mysql_error()); 
Does anyone see anything wrong with that code?
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 09-03-2008, 09:55 PM Re: mysql_num_rows issue.
Experienced Talker

Posts: 33
Trades: 0
$result = mysql_query($query);

$no_recs = mysql_num_rows($result);
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
scriptdance is offline
Reply With Quote
View Public Profile
 
Old 09-03-2008, 09:58 PM Re: mysql_num_rows issue.
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
XD oooops, durr. Thank you.
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
Old 09-04-2008, 02:08 AM Re: mysql_num_rows issue.
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
select count(*) from table to get the total number of records. selecting * just to get the number of records will work slower and slower as the records are added and one day you will fail with out of memory error
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to mysql_num_rows issue.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19712 seconds with 12 queries