There is a variable in which the content is:

Array ( [0] => stdClass Object ( [COUNT(*)] => 449 ) ) 

How do I output 449 using echo in PHP?

  • one
    when creating a query of the form "SELECT COUNT ( ) ..." it was possible to write like this: "SELECT COUNT ( ) AS count " - zloctb

2 answers 2

And the usual way is no longer in vogue? :)

 echo $array[0]->{"COUNT(*)"}; 
  • Thank you very much! - spoilt

try

 echo $array[0]['COUNT(*)']; 
  • I tried, displays nothing ;-( - spoil