I have made request to SQL:
SELECT meta_value, COUNT(*) from wp_postmeta;
and have in respond an array:
array (size=102)
0 =>
object(stdClass)[24]
public 'meta_value' => string '37' (length=2)
public 'COUNT(*)' => string '147' (length=3)
1 =>
object(stdClass)[23]
public 'meta_value' => string '32' (length=2)
public 'COUNT(*)' => string '143' (length=3)
I take "meta_value" without any troubles with php code:
$result->meta_value;
But how take values of public 'COUNT(*)' => string '143' (length=3)? I have tried different syntaxis and some errors only.
I need values: 147,143...
SELECT meta_value, COUNT(*) as xy from wp_postmeta;does that do the trick for you?SELECT name as xy from table where id = 1))