*** sahm escribió/wrote (Sat, 20 Sep 2008 01:57:28 -0700 (PDT)):
I having problem using count() function
when I use count() the result came multiply 2
and this is my code :
////////////////////////////////////
$sql2 = "select * from user_previlag WHERE User_email= '$userEmail'";
$data2 = mysql_query($sql2);
$info = mysql_fetch_array($data2);
echo count($info);
From
http://php.net/mysql_fetch_array:
array mysql_fetch_array ( resource $result [, int $result_type ] )
result_type: The type of array that is to be fetched. It's a constant and
can take the following values: MYSQL_ASSOC, MYSQL_NUM, and the default
value of MYSQL_BOTH.
Return Values: [...] The type of returned array depends on how result_type
is defined. By using MYSQL_BOTH (default), you'll get an array with both
associative and number indices.
So your problem has nothing to do with count(). Also, have a look at
http://php.net/print_r
--
--
http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
http://bits.demogracia.com
-- Mi web de humor en cubitos:
http://www.demogracia.com
--