<?php

include_once('inc/config1.php');
include_once('hf.php');
ini_set('display_errors',1);

/*echo $existingEmails = qryToCommaSepString("
        SELECT email as em
        FROM `tbl_members`
        WHERE email in ('info@bmr.ae','jenin@recycleinme.com','mbenny6@gmail.com','btaylor@gie.net','assteelnetwork@gmail.com')      
        
        UNION
        
        SELECT addtnl_email as em
        FROM `tbl_members`
        WHERE addtnl_email in ('info@bmr.ae','jenin@recycleinme.com','mbenny6@gmail.com','btaylor@gie.net','assteelnetwork@gmail.com')      
        
        group by em
    ");

echo "<br><br>";

   echo $memids = qryToCommaSepString("
        SELECT DISTINCT id
        FROM `tbl_members`
        WHERE email in ('assteelnetwork@gmail.com','btaylor@gie.net','info@bmr.ae','mbenny6@gmail.com')      
        
        or addtnl_email in ('assteelnetwork@gmail.com','btaylor@gie.net','info@bmr.ae','mbenny6@gmail.com')      
        
        group by id
    ");    */




/*$sel= qryToCommaSepString("SELECT registering_id FROM final_status WHERE (closed='Y' OR complementary='Y') AND eventid=11 ");
echo "Select:".$sel;
echo "<br>";
$aa=count(explode(',',$sel));
echo "Count: ".$aa;
echo "<br>";
$arrays=(array_chunk($aa,100));
		foreach($arrays as $arr){
			 echo implode(',',$arr);
			 echo "<br>";
		}

 echo "<hr>";*/
function runquery_select($query_val){
        //echo "<h3> Query  : </h3> " . $query_val;
        //echo "<hr / >";
        $query = mysql_query($query_val) or die(mysql_error());
        $a=1;
        echo "<table border=1>";
        echo "<tr>";
        echo "<td>Sno.</td>";
        for($j=0; $j<mysql_num_fields($query);$j++)
        {
            echo "<td>".mysql_field_name($query,$j)."&nbsp;</td>";
        }
        echo "</tr>";
        while($row= mysql_fetch_assoc($query))
        {
            
            
            echo "<tr>";
            echo "<td>".$a++."</td>";
            foreach($row as $r){
                echo "<td>".$r."&nbsp;</td>";
            }
            echo "</tr>";
        }
        echo "</table>";
        echo "<hr>";
        
    }
//87178,87186
	/*$qry1="SELECT * FROM final_status order by id desc limit 0,50";
    $qry="SELECT * FROM tbl_members WHERE id IN ('82830','16315','87191','87186')";
    $qry="SELECT * FROM tbl_members WHERE id LIKE '87224'";*/

//echo runquery_select($existingEmails);
//echo runquery_select($memids);

    /*$qry="SELECT name,username,password,verified FROM tbl_members where id IN (87389,87373,87390,42630,62302,64562,72708,87224,87372,69873,65561,38595,87353,87352,87326,87320,87319,65164,72728,78631,87361,86228,85077,87305)";*/

    //$formula='formula_1'; $latestPrice=100;
    $q="select * from tokens where id=93129 limit 0,15";
    $q1="select * from gcm_device where user_id=93129 limit 0,15";
    $q2="select * from gcm_device_copy where 1 limit 0,15";
            echo $q;
            echo "<br>";
    /*$qry1="SELECT * FROM tbl_reg_logs WHERE 1 order by id desc limit 0,5";
    $qry="SELECT * FROM tbl_updated_reg_logs WHERE 1 order by id desc  limit 0,5";
    echo "tbl_members"."<br>";
    echo runquery_select($q);
    echo "tbl_reg_logs"."<br>";
    echo runquery_select($qry1);*/
    //echo "pipe_order"."<br>";
    echo runquery_select($q);
    echo "<br>";
    echo "<br>";
    echo $q1;
    echo "<br>";
    echo "<br>";
    echo runquery_select($q1);
    echo $q2;
    echo "<br>";
    echo "<br>";
    echo runquery_select($q2);


    

include_once('inc/desconfig.php');
?>