Re: lenght of a record

From: Date: Fri, 28 Sep 2001 14:05:16 +0000
Subject: Re: lenght of a record
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-12818@lists.php.net to get a copy of this message
The only difference between mysql_fetch_row and mysql_fetch_array is that row is an enumerated array, and array is an associative one. So for your problem just use count as you would with any enumerated array: $result=mysql_query($sql,$conn); $row=mysql_fetch_row($result); $num = count($row); for($i=0;$i<$num;$i++) { echo $row[$i]; } Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com ----- Original Message ----- From: "its me" <fotna@egypt.net> To: <php-db@lists.php.net> Sent: Friday, September 28, 2001 5:41 AM Subject: [PHP-DB] lenght of a record > how can i get the length of a record: > to make something like this: > > $result=mysql_query($sql,$conn); > $row=mysql_fetch_row($result); > for($i=0;$i<record_length;$i++) > { > echo $row[$i]; > } > > i need it like this as i don't want to use mysql_fetch_array > > > > ------------------------------------------------------------ > ------------------------------------------------------------ > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#12818) next »