Re: error on count()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 1. I tired to get the array like this:
> >  $una = $check["uname"];
> > function orderquantity ($una) {
> >   $pss = mysql_query("SELECT OID FROM orders WHERE
> una = '".trim($una)."'") or die (mysql_error("Query
> error on Order search"));
> >   while($pisao=mysql_fetch_array($pss)) {
> >   return count($pisao);
> >   }
> > }
> > $okuan = orderquantity();
> >  

first of all you should pass a variable to the
function.

Second :: function will just return one in any
condition because $pisao is the array of return fields
in the particular row. you should use
mysql_num_rows($pss).

no need of mysql_fetch_array()

just return mysql_num_rows{$pss) after executing
query.


Third , I think it is best to use sensible variable
like $query, $result, $row etc., well its depends on
you.

zareef ahmed 



=====
Homepage :: http://www.zasaifi.com


		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux