Jump to content

[SOLVED] Loop help, and database creation too...


lupld

Recommended Posts

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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...)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.