Hi I have this code sample:
<form action="" method="post">
<input type="submit" name="submit" value="submit">
</form>
<?php
$db = new mysqli("localhost", "root", "root", "testurl");
if (isset($_POST['submit'])) {
$query = "SELECT * from url ORDER BY id";
$result = $db->query($query);
// fetch (for sample purpose only)
$data = array();
while ($row = $result->fetch_array()) {
$data[] = $row;
}
foreach ($data as $row) {
$url = $row['url_data'];
// do ajax here to check each url
}
}
?>
All the code is working well until I display the data inside foreach loop. My problem is the list in SQL is lot of data and when I use a foreach loop the server will timeout. set_time_limit
is not an
option and I need this to be done in AJAX to avoid timeout.
The point is to check each URL that I get from the query using AJAX.
Anyone can help me?
Thank you Patty