This is my php script
$result = mysql_query("SELECT * FROM photos WHERE perID=2");
$row = mysql_fetch_array($result);
$a = count($row); // or sizeof($row)
echo $a; //outputs 22 but i expect it to be 11 but why does it output 22 ?
This is the data in mysql.
perID one two three four five six sev eit nine ten
2 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg 6.jpg 7.jpg 8.jpg 9.jpg 10.jpg
I expect it to be 11 but surprisingly its 22. Could anyone explain me why? Does it also include the 'one' 'two' (the column names) stuff too in the count function ? because it would be 22, if only if it includes them.
But it should not include the column part of table as they are headers right? please help me with these Any help is greatly appreciated
also please give me a link or the way to achieve 11 as result