php - Accessing query value after UNION statement -


so i'm grabbing 2 sets of data database, , need merge them union, i'm not sure how access second set of returned values php. appreciated! sample code:

$cracked=mysql_query("select `49`.`counter` `all_user_data`.`49`  union select `50`.`counter` `all_user_data`.`50` ");  $result = mysql_fetch_array($cracked); $thing=($result[0]); //i want grab $result[1]; echo $thing; 

the values returned together. need loop on entire array.

$values = array(); while ($row = mysql_fetch_assoc($cracked)) {     $values[] = $row['counter']; } 

by way should switch ext/mysql mysqli/pdo if can.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -