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! Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
asmith Posted August 3, 2008 Share Posted August 3, 2008 I edited my post. Quote Link to comment Share on other sites More sharing options...
vicodin Posted August 3, 2008 Author Share Posted August 3, 2008 Ohh i see it... Thanks!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.