473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Counting entries: php / mysql

35
Edit: Gosh I should really sleep. I was looking at my article numbers, not my ACTUAL DB numbers; seems I had deleted some blogs or something but it kept marching forward, so there was a discrepancy between article numbers vs actual blogid. So, if a mod can delete this, I'd be fine with that (I guess I can't delete the thread). Thanks for any time anyone spent reading this.


I am for some reason not getting this, and maybe someone else can see what I'm doing wrong. I am trying to add pagination to my website, and everything is pretty good except the count of my blog entries is wrong; I have 143 and it says 124 total.

Here's what I mean:
[PHP]
$nav_sqlcount = "SELECT count(*) FROM blog";
$getcount = mysql_query($nav_sqlcount) or die('problem getting count: '.mysql_error());
$total_results = mysql_result($getcount, 0) or die('problem getting total results: '.mysql_error());
echo $total_results;
[/PHP]

Now my understanding is that it first is getting the count of all (*) entries in the blog table, and then creating a readable result with mysql_result, beginning at row 0. So why is it coming up as 124 instead of 143 when I echo $total_results? Am I misunderstanding what's happening here?
Aug 11 '07 #1
1 1169
Atli
5,058 Expert 4TB
That looks right. Are you sure you have 143 records, and not 124?
Aug 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mr_burns | last post by:
hi, i am wanting to count the number of unique rows under a certain column. i want to count how many times a page has been accessed. how i plan to do this is every time a page is accessed, a...
1
by: Gary Lundquest | last post by:
It appears to me that MySQL version 4 returns an error messge when doing an Insert that results in duplicate entries. Version 3 did NOT return an error - it dropped the duplicate entries and ran...
1
by: Gary Lundquest | last post by:
It appears to me that MySQL version 4 returns an error messge when doing an Insert that results in duplicate entries. Version 3 did NOT return an error - it dropped the duplicate entries and ran...
2
by: StevePBurgess | last post by:
Hi. I have a script that runs every night on my server that counts the hits for my hosted RSS feeds and puts the information into a MySQL table which then feeds the live(ish) statistics graphs on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.