How to get the correct number of columns from mysql_fetch_array()?

ddl123

New Member
Here is a line of my code\[code\]while($row = mysql_fetch_array($result))\[/code\]I want to get how many columns are in the row. I tried \[code\]count($row)\[/code\] but this returned what I think is the number of cells for the whole $results.i.e there are actually 7 columns, and 2 rows and \[code\]count($row)\[/code\] returned 14. I want a function that will return 7.Can you see where I'm going wrong.Thanks in advance.EDIT - Answer foundPassed \[code\]MYSQL_NUM\[/code\] as a second parameter to \[code\]mysql_fetch_array\[/code\].
Thanks anyway to everyone's answers.
 
Back
Top