lupld Posted August 13, 2007 Share Posted August 13, 2007 k, here is the problem... I have created a database with 10000 entries in it, and I used a script I made to complete this as a loop... The problems is it takes an hour plus to complete. I tried to write it as a for loop, while loop, and do... while... loop. All the files will be put here in a zip format... The way the working one works is it takes info from a form, starts the script, and then the script sets up the data in sessions, puts in the first entry, sets session variables, and then headers off to another page. The second page increments everything by one where needed, and checks for special attributes. Then it sets the variables and headers off to the first page again for submission, then the first page checks for 2 special conditions, and headers off to the other page again to make a loop of thousands of connections from my computer to the server... I want to make a for loop or something that would work similarly, but I can't get them to work properly.... now that's done.. I have the second attempt set up to add another 10,000 rows to the database.. doesn't have to be a loop if somebody knows how to accomplish entries based on the one before them... with special factors...... *edit* also, I won't be able to check this till tonight or this afternoon.. so it's not a huge rush....*edit* [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 13, 2007 Share Posted August 13, 2007 sorry but I tried reading and got lost... it doesn't really explain WHAT you are tyring to do - just that you keep 'headering' from one page to the next (which is where the time lag is); would be really helpful to see some code then we could see WHAT you are trying to do. Quote Link to comment Share on other sites More sharing options...
lupld Posted August 13, 2007 Author Share Posted August 13, 2007 I put it in the zip file at the bottom of my first post, because the code was so long.... it's all there, what I started out with, and what I'm trying to accomplish now... It sets up left, right, north, and east boundaries of a grid.... and puts all the rooms into the table... it's basically a loop.. which is why I'm leaning towards a loop being an answer... but you never know.. might not even be php.. might end up being some database fuction... the initial script that's working is the form (roommakerhtml.php) and the loops (roommaker2.php and roommaker3.php) and the attempt at using a loop is roomcreator.php.... Quote Link to comment Share on other sites More sharing options...
lupld Posted August 14, 2007 Author Share Posted August 14, 2007 bump.. wow this forum is busy lately.... Quote Link to comment Share on other sites More sharing options...
PhaZZed Posted August 14, 2007 Share Posted August 14, 2007 Ouch, that's some strange code you have there! Why all the session registering, and what's up with that massive if OR statement? Quote Link to comment Share on other sites More sharing options...
lupld Posted August 14, 2007 Author Share Posted August 14, 2007 mass if or statement sets the left and right edge of the grid to a blank string... and then gets replaced after it's submitted back on roommaker2... the session variables is what I want to replace... takes tons of time to run it that way..... that's why I'm trying to make roomcreator to work... no session variables.... also, it's only supposed to be ran once and then taken off the server... Quote Link to comment Share on other sites More sharing options...
lupld Posted August 15, 2007 Author Share Posted August 15, 2007 bump... Hey... if this is too hard to understand the code.. I just need to know how to make a mysql table by auto-incrementing a few values, setting them blank if necessary, and then stopping once a certain number is reached.. all while putting them into the database... my working method is very inefficient, and the other one looks like it should work but doesn't... (roommaker series works, roomcreator doesn't...) example.. a 10 by 10 grid, with a value for the room east, north, south, and west of it, as well as up and down. There's a pattern to it, that lets me just autoincrement most of it, but the edge rooms have to be set blank for I can "if" statement them not to submit on the page used to show the rooms.... if really necessary I'll put on here what the inefficient code generates in and .sql file.. (opens in text documents...) Quote Link to comment Share on other sites More sharing options...
lupld Posted August 15, 2007 Author Share Posted August 15, 2007 eh... I'm done with this.. I'm going to start a new post oriented a bit different.. this one's not going anywhere fast.. I'll still check back if there's a new post here by tomorrow.... maybe 2 days... Quote Link to comment Share on other sites More sharing options...
lupld Posted August 15, 2007 Author Share Posted August 15, 2007 The answer to this is on page http://www.phpfreaks.com/forums/index.php/topic,154946.0.html... nobody understood this... dunno why.. I guess it is explained better in the other post... 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.