Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member Lucian's Avatar
    Join Date
    Aug 2003
    Location
    tennessee
    Posts
    18
    Member #
    2765
    Hi again, everyone!

    Ok.

    Let's say you're developing a database administration application that has two main functions.

    1. The ability to batch import a huge csv file to a specific table (identified as Leadhost) that contains a %#^@load of data. I think that can be done just by going through phpmyAdmin and using the "insert textfiles into table" option. That should do it right?

    2. the ability to fetch a # of records from table (Leadhost) and create a new table identified by a persons clickbank nickname containing those records. The records fetched from the table "Leadhost" would then be deleted from Leadhost.

    Is that a terribly difficult chunk of code to execute? I am fairly novice at this aspect of php, and probably have no business handling this job, but I'm trying to help a friend out who is running on a pretty tight deadline, and thought you guys might be of some help!

    Thanks a lot everyone!

    Lucian
    Are your website promotion efforts yielding less than satisfactory results? Check out the Website Promotion Tips Blog for help!

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    This can be done, but PHP / MySQL isn't your best choice of a language.

    The first one is really simple with PostgreSQL, like so:

    SELECT column1, column2, column3
    INTO TABLE new_table -- New table must not exist
    FROM old_table
    ORDER BY column1 ASC

    Not sure if this also works in MySQL.... research it.

    The second one really requires a stored procedure and / or transactions to execute properly. The reason is, what happens if the thing crashes half way through? Then you've got duplicated data.

    Also, it looks like you're doing a banking application? PHP / MySQL is SO wrong for that. Everything in a banking app is transactional.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    MySQL has:
    Code:
    INSERT INTO table SELECT columns
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    That assumes the table already exists though, which would require the addition of CREATE TABLE table, which would also require a transaction.

  6. #5
    Junior Member Lucian's Avatar
    Join Date
    Aug 2003
    Location
    tennessee
    Posts
    18
    Member #
    2765
    The application is just going to be creating database tables that will interface with an autoresponder. we've decided to identify the tables by the client's clickbank nicknames, as no two of them can be alike.

    Am I correct in thinking that this would make it faster to search the database when necessary?

    There are not actual bank type transactions involved. Basically the system will work like membership autoresponders such as autopilotriches.com

    The actual marketing for the system will be done using direct mail marketing methods though, so all we had to create was the database admin panel to set up the new client's account for the autoresponder, and then of course the client side application which is a pre-loaded autoresponder customized with their clickbank links for the products marketed through the sequential autoresponder messages.

    Right now we're just trying to work the bugs out, and since my programmer lives like half a world away, that's why I keep coming to you guys to help me clarify to him what exactly is needed.

    You all have been absolutely fantastic!

    Thanks

    Lucian
    Are your website promotion efforts yielding less than satisfactory results? Check out the Website Promotion Tips Blog for help!

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Sounds like you're designing your application wrong. You should never name tables according to metadata, and you should never have to create, alter, or delete tables. Maybe you should post a bit more about the application and the schema here so we can give you some ideas for a better design that won't require using DDL in your app.

  8. #7
    Junior Member Lucian's Avatar
    Join Date
    Aug 2003
    Location
    tennessee
    Posts
    18
    Member #
    2765
    hmmm... it seems that we got it working. I don't know what my buddy did to change it, but it looks like we got everything worked out. I showed him this forum thread and then he just went to work and fixed it.

    Thanks for all your help guys!

    Lucian
    Are your website promotion efforts yielding less than satisfactory results? Check out the Website Promotion Tips Blog for help!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:47 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com