I am using a query ("SHOW COLUMNS FROM XYZ_table"). It displays the out like
Array ( [Field] => policyID [Type] => int(10) [Null] => YES [Key] => [Default] => [Extra] => ).
I am only concerned with PolicyID with it's type => int and size 10. How can I ignore other irrelevant data ?
Here is a code:
/* $i has size of this array "$tb_names" */
while ($i!=0){
$result = mysql_query("SHOW COLUMNS FROM $tb_names[$j] ");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$var = print_r($row,true);
echo $var."<br>";
}
}
$i--;
$j++;
}