MySQL Forums
Forum List  »  PHP

Re: How to put the array into a single variable.
Posted by: Peter Brawley
Date: September 11, 2016 01:21PM

get_results() is a wordpress library func, right? Manual page for it is at https://developer.wordpress.org/reference/classes/wpdb/get_results/. It seems to return an array of row results. Select Count(*) will return one row with one cll in it, so ...

$a = get_results( ... ) or exit( mysqli_error(...) );
if( count($a) ) $mycount = $a[0][0];

Options: ReplyQuote


Subject
Written By
Posted
Re: How to put the array into a single variable.
September 11, 2016 01:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.