note 44125 deleted from function.mysql-fetch-array by tomsommer

From: Date: Thu, 15 Jul 2004 16:59:31 +0000
Subject: note 44125 deleted from function.mysql-fetch-array by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-73312@lists.php.net to get a copy of this message
Note Submitter: noemail@me.com ---- I ran into this problem and I hope it helps other beginners out. If you're trying to use count() with mysql_fetch_array() you will get 2x as many elements (columns/lenght) returned. ie: If I have 2 columns 'lastname', 'firstname" I would get count() = 4. I believe this is because it returns both a numberic and an associative array by default. I used mysql_fetch_row() and I get the corrent number (in this example = 2). I haven't tried it with passing a 2nd parameter to fetch_array because I'd rather use the original function. Cheers

« previous php.notes (#73312) next »