PHP Stock Market Analyzer – 9 – Creating Tables for the Database

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

9 responses to “PHP Stock Market Analyzer – 9 – Creating Tables for the Database”

  1. Mentalstrider Avatar

    Why would you store calculated data in your table? Just read your base data and calculate with that in your program, waste of bytes.

  2. Driamer Avatar

    I'm not sure, but I have the feeling that it is more efficient to check it once outside the loop than use that option during the loop.

  3. Atomic Gaming Avatar

    How about

    CREATE TABLE IF NOT EXISTS $tableName

  4. Driamer Avatar

    I agree. And even further I think that querying through the entire table is not efficient, it would be better to use "SHOW TABLES LIKE $tableName"

  5. Clark Vincent Enriquez Avatar

    I really laugh out loud when you said "So now you know behind the scenes of how I check queries, embarrassing!" hahahahah!!!!! I thought you will say something else… xDD

  6. PancakePlease Avatar

    @vaheks13 I thought you were wrong at first but it looks like you're right. It would not run the check and send the query over and over during the WHILE loop if you put the check/createtable before it. Good call. I wonder if there's something I'm not aware of that made bucky do it this way though. probably easier to understand if they're clumped together for beginners.

  7. PancakePlease Avatar

    @MrSumeetSarna Why would dates be the same? Dates can't be the same in this scenario. We're pulling stock data from every day starting at a beginning date until an end date. There's 1 set of data for each day. It will never be exactly the same since it goes 01-01-2005, 01-02-2005, 01-03-2005…. 01-01-2006, etc. Dates are unique in this case.

  8. vaheks Avatar

    The table should be checked/made before the loop. Right now the script isn't very time efficient.

  9. Hamza Shoaib Avatar

    Was going to do a fully capitalized comment stating that i was first ending with multiple exclamation marks… but decided not to.

Leave a Reply

Your email address will not be published. Required fields are marked *