Hi
I have in the same database different tables:
Inter_main_USA
Inter_main_Canada
Inter_main_Uk
And so on...
How can I in the same query in order to list me all the countries if meet the conditions sales=’1’ and active=’1’.
I did:
$country=$_GET['country'];
$database="name";
$connect = mysql_connect ("server", "username", "pass") or die ("bla...bla...");
mysql_select_db($database, $connect) or die ("bla...bla...");
$sql="select * from inter_main_".country." where sales = '1' and active = '1' group by country asc";
$result = mysql_db_query("database", $sql);
<? while($regist=mysql_fetch_array($result)){
$arr=$regist ['country']; ?>
<tr>
<td><? echo substr($arr, 0,24); ?>.</a></b></td>
</tr>
<? } ?>
This only gives me the list of countries in the country column that are in the same table: inter_main
Thanks


Reply With Quote
Bookmarks