Really hope you can help with this one

I have a problem whereby i cant get all my data (over 1million and different csv files) to map and import properly, so i thought it would be better to create new tables with all the information seperate (which i can do within a few seconds each time). The only problem is my code currently just checks one table, how would i get it to do the same as now but check for example 5 different tables for the information

My current code is as below

all connection details:

<?php
$result = mysql_query("SELECT * FROM TABLE Where Name LIKE 'Smith%' ORDER BY Field10 asc") 
or die(mysql_error());  

echo "<table class = results >";
echo "<tr> <th>Field1</th> <th>Field2</th> <th>Field3</th> <th>Field4</th> <th>Field5</th> <th>Field6</th> <th>Field7</th> <th>Field8</th> <th>Field9</th> <th>Field10</th> <th>Field11</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
    // Print out the contents of each row into a table
    echo "<tr><td>"; 
    echo $row['Field1'];
    echo "<img src='".$row['ImageUrl']."'width='60' height='80'/>";
    echo "</td><td>";
    echo $row['Field2'];
    echo "</td><td>"; 
    echo $row['Field3'];
    echo "</td><td>";
    echo $row['Field4'];
    echo "</td><td>";
    echo $row['Field5'];
    echo "</td><td>";
    echo $row['Field6'];
    echo "</td><td>";
    echo is_null($row['Field7']) ? "N/A" : $row['Field7'];
    echo "</td><td>";
    echo $row['Field8'];
    echo "</td><td>";
    echo $row['Field9'];
    echo "</td><td>";
    echo $row['Field10'];
    echo "</td><td>";
    echo sprintf( '<a href="%s"><img src="%s"/></a>', $row['Field11'], '/buyNow.gif' );
    echo "</td></tr>";
} 

echo "</table>";
?>

Thanks if someone can help

Wrap your query in a "foreach loop" (looping through the table names) and make the table name the variable from the "foreach loop".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.