vicodin Posted August 3, 2008 Share Posted August 3, 2008 I just wrote this and when it tries to execute it just times out... Any ideas why? This is my form: <form action ="eupdate.php" method ="post" name="updateevents"> <table width="auto" cellpadding="2" cellspacing="2" border="0" id="startevents"> <tr> <td class="eventtop">Pos.</td> <td class="eventtop">Event Name</td> <td class="eventtop">Event Link</td> <td class="eventtop">Event Date</td> </tr> <tr> <td class="event"><input type="text" name="enum[]" value="'.$row['num'].'" maxsize="1" size="5"></td> <td class="event"><input type="text" name="event[]" value="'.$row['event'].'" size="25"></td> <td class="event"><input type="text" name="elink[]" value="'.$row['link'].'" size="25"></td> <td class="event"><input type="text" name="edate[]" value="'.$row['date'].'" size="10"></td> </tr> <tr> <td class="event"><input type="text" name="enum[]" value="'.$row['num'].'" maxsize="1" size="5"></td> <td class="event"><input type="text" name="event[]" value="'.$row['event'].'" size="25"></td> <td class="event"><input type="text" name="elink[]" value="'.$row['link'].'" size="25"></td> <td class="event"><input type="text" name="edate[]" value="'.$row['date'].'" size="10"></td> </tr> <tr> <td class="event"><input type="text" name="enum[]" value="'.$row['num'].'" maxsize="1" size="5"></td> <td class="event"><input type="text" name="event[]" value="'.$row['event'].'" size="25"></td> <td class="event"><input type="text" name="elink[]" value="'.$row['link'].'" size="25"></td> <td class="event"><input type="text" name="edate[]" value="'.$row['date'].'" size="10"></td> </tr> <tr> <td class="event"><input type="text" name="enum[]" value="'.$row['num'].'" maxsize="1" size="5"></td> <td class="event"><input type="text" name="event[]" value="'.$row['event'].'" size="25"></td> <td class="event"><input type="text" name="elink[]" value="'.$row['link'].'" size="25"></td> <td class="event"><input type="text" name="edate[]" value="'.$row['date'].'" size="10"></td> </tr> <tr> <td class="event"><input type="text" name="enum[]" value="'.$row['num'].'" maxsize="1" size="5"></td> <td class="event"><input type="text" name="event[]" value="'.$row['event'].'" size="25"></td> <td class="event"><input type="text" name="elink[]" value="'.$row['link'].'" size="25"></td> <td class="event"><input type="text" name="edate[]" value="'.$row['date'].'" size="10"></td> </tr> </table> </form> This is my script: mysql_select_db("Mydb") or die(mysql_error()); for ($i = 0; $i = count($_POST['enum']); $i++) // Line 13 { mysql_query("UPDATE events SET date = '{$_POST[edate][$i]}', event = '{$_POST[event][$i]}', link ='{$_POST[elink][$i]}',num = '{$_POST[enum][$i]} ' WHERE id = '$i'") or die (mysql_error()); } echo 'Events Have Been Updated. Check Front Page to make sure it looks ok.... To go back to editing page <a href=" panel3.php">Click Here</a>'; It errors out to: Fatal error: Maximum execution time of 30 seconds exceeded in /home/mediapil/public_html/admin/eupdate.php on line 13 Thank you! Link to comment https://forums.phpfreaks.com/topic/117924-server-times-out-help/ Share on other sites More sharing options...
asmith Posted August 3, 2008 Share Posted August 3, 2008 sorry i made mistake. for ($i = 0; $i == count($_POST['enum']); $i++) // Line 13 or for ($i = 0; $i >= count($_POST['enum']); $i++) // Line 13 Link to comment https://forums.phpfreaks.com/topic/117924-server-times-out-help/#findComment-606563 Share on other sites More sharing options...
vicodin Posted August 3, 2008 Author Share Posted August 3, 2008 I need that though because i have them numbered in my db and it gets ordered by them Link to comment https://forums.phpfreaks.com/topic/117924-server-times-out-help/#findComment-606564 Share on other sites More sharing options...
vicodin Posted August 3, 2008 Author Share Posted August 3, 2008 Its using that count() so it should just count the number of arrays in it and thats it. Link to comment https://forums.phpfreaks.com/topic/117924-server-times-out-help/#findComment-606566 Share on other sites More sharing options...
asmith Posted August 3, 2008 Share Posted August 3, 2008 I edited my post. Link to comment https://forums.phpfreaks.com/topic/117924-server-times-out-help/#findComment-606567 Share on other sites More sharing options...
vicodin Posted August 3, 2008 Author Share Posted August 3, 2008 Ohh i see it... Thanks!!! Link to comment https://forums.phpfreaks.com/topic/117924-server-times-out-help/#findComment-606569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.