I'm fairly new to php, hoping someone can help. I have a webpage that displays records from a table. The problem is that viewing the page on via any browser other than a browser directly on the server gives me a timeout
Out of curiosity, what is your time limit? It shouldn't matter, but I was just curious.
error. When run on the server, it's extremely fast. What am I doing wrong? (I tried indexing the city fields). This is on a win2003 server.
The code is below.
<? // open database connection db_connect(); // generate and execute query $query = "SELECT * FROM milage ORDER BY city"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // if records present if (mysql_num_rows($result) > 0) { // iterate through resultset // print title with links to edit and delete scripts
This loop is likely your culprit. How many rows are you returning? Is it the result set that you expected to have?
while($row = mysql_fetch_object($result)) { ?> <tr><td> <font size="2"><b><? echo $row->city; ?></b></font></td> <td> <font size="2"><b><? echo $row->miles; ?></b></font></td> <td><font size="2"><a href="edit.php?id=<? echo $row->cityid; ?>">Edit</a></td> <td><a href="delete.php?id=<? echo $row->cityid; ?>">Delete</a></font></td> </tr> <? } }
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php