1:分部查找,再存储,比方说:$contain['test1'] = 1;$contain['test2'] = 2;
2:一次联查,$sql ="SELECT test1.`filed`,test2.`filed`,test3.`filed` FROM `test1` AS `test1`,`test2` AS `test2`,`test3` AS `test3`";
2:一次联查,$sql ="SELECT test1.`filed`,test2.`filed`,test3.`filed` FROM `test1` AS `test1`,`test2` AS `test2`,`test3` AS `test3`";
$str = '102';
for($i = 0; $i < strlen($str); $i++)
{
$key = 'test' . ($i + 1);
$a[$key] = $str[$i];
}
print_r($a);
?>Array ( [test1] => 1 [test2] => 0 [test3] => 2 )