
let's say I have two database tables
FruitsTable
Id..........name..........color
13..........a..................green
25..........k..................yellow
32..........o..................red
VegetablesTable
Id..........name..........color
13..........d..................green
25..........g..................white
32...........l..................red
now can I do that ?
PHP Code:
<?php
$fields="Id,name";
$tables="FruitsTable,VegetablesTabes";
$conditions="color in 'green,red'";
$sql="SELECT $fields FROM $tables WHERE $conditions";
?>

