Only 725 of 753 records being returned by select all??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

NewDevGuy
Forum Newbie
Posts: 15
Joined: Thu Jan 15, 2009 6:24 am

Re: Only 725 of 753 records being returned by select all??

Post by NewDevGuy »

I was running the previous queries from the CLI on a local copy of the DB, so I'm just writing a script to do the same query on the remote copy of the DB. Will just be another couple of minutes. Sorry about the delay.
NewDevGuy
Forum Newbie
Posts: 15
Joined: Thu Jan 15, 2009 6:24 am

Re: Only 725 of 753 records being returned by select all??

Post by NewDevGuy »

Ok, I ran that and just got out a list of numbers from 1 to 753 - do you want me to post the numbers? I've gone through them and there's no numbers skipped and no null values. Here's the code I used:

$SQL = "SELECT MemID FROM members";
$result = mysql_query($SQL, $conn) or die(mysql_error());
while($row=mysql_fetch_array($result)){
echo ($row[MemID]."<br>");
}
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Only 725 of 753 records being returned by select all??

Post by VladSun »

VladSun wrote:Just in case - try
[sql]SELECT * FROM members ORDER BY MemID[/sql]
Did you try it?
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Only 725 of 753 records being returned by select all??

Post by onion2k »

Also, try "SELECT MemID FROM members GROUP BY MemID". That'll give you a clear indication of how many member ids there are, pointing to whether or not there are any duplicate or NULL entries.
NewDevGuy
Forum Newbie
Posts: 15
Joined: Thu Jan 15, 2009 6:24 am

Re: Only 725 of 753 records being returned by select all??

Post by NewDevGuy »

VladSun,
I ran that:

SELECT * FROM members ORDER BY MemID;

And got the exact same result set back.

onion2k,
I also ran your query: no duplicates, which is as expected as MemID is the Primary Key.
Post Reply