0

Im trying to get the queries and results to load quicker. I have 10 of these after each other with slightly different queries, how can i optimize this please, i have tried removing select * and entering the field names require (which is about 9 rather than the 40 with * but it still is very slow).

<?php
$con;
$result = mysql_query("SELECT * FROM table WHERE `Field.1` = '$test' and `Field.2` > $test1 ORDER BY `Field.3` + 0 LIMIT 3") 
or die(mysql_error());  
 
echo "<table class = sample >";
echo "<tr> <th>h1</th> <th>h2</th> <th>h3</th> <th>h4</th> <th>h5</th> <th>h6</th> <th>h7</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['h1'];
	echo "</td><td>";
        echo $row['h2'];
	echo "</td><td>"; 
	echo $row['h3'];
	echo "</td><td>";
	echo $row['h3'];
	echo "</td><td>";
	echo $row['h4'];
	echo "</td><td>";
	echo $row['h5'];
	echo "</td><td>";
	echo $row['h6'];
	echo "</td><td>";
	echo $row['h7'];
	echo "</td><tr>";
} 
 
echo "</table>";
?>
3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.