Hey everyone! i am trying to fetch data from multiple tables, but my code is displaying the data of only one table. I don’t know why it is showing data of single table…
here is my code
[php]
<?php $localhost="localhost"; $dbuser="root"; $dbpass=""; $dbname="shoppro"; $connect=mysql_connect($localhost,$dbuser,$dbpass); if ( !$connect ) { echo "Error connecting to database.\n"; } mysql_select_db("$dbname",$connect); $count = "select count(*)-1 from core_store_group"; $sql = ''; for($i=0;$i<2;$i++){ $sql="select name,price,short_description,sku,weight,promotion from catalog_product_flat_".$i; $result=mysql_query($sql); } while($row=mysql_fetch_array($result)){ echo $row['name']; echo ""; } ?>
[/php]
Please help me !!