Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • php update question (In: Coding & Databases - PHP, ASP, Perl, etc.)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    catplus
    Joined: Feb 23, 2005
    # Posts: 1

    View the profile for catplus Send catplus a private message

    Posted: 2005-Feb-24 12:18
    Edit Message Delete Message Reply to this message

    Dear PHP experts!

    Two tables, besides others on a Microsoft SQL 2000 database are:

    (1) Member Profile
    (2) Member Activity

    (1) Includes Member profile including ID, user name, address, telephone, e-mail address, password, password challenge questions, etc.

    (2) Includes Member's order details including date order placed, items, unit and extended price, etc.

    For (1), a PHP will connect to the SQL 2000 database and dump a file to an e-mail address provided. The file will be uploaded into a local database on a LAN not connected to the SQL 2000

    For (2), a PHP will connect to the SQL 2000 database, delete all records in a table and upload all records from a CSV file

    Please help help me with coding the two PHP scripts

    Thank you

    Mickey Shekdar
    ms@catplus.com



    NEntropy
    Joined: Dec 08, 1999
    # Posts: 1117

    View the profile for NEntropy Send NEntropy a private message

    Posted: 2005-Feb-25 06:11
    Edit Message Delete Message Reply to this message

    You'll need to use PHP's Microsoft SQL Server Functions. That should be your starting point. First, try to connect using mssql_connect function and run a somple SELECT query using mssql_query. Once that's done, then you can basically build on top of that. There are sample codes provided in the user contributed notes within the PHP Manual.

    I don't think I quite understand what you're trying to do with 1... but if all you're doing is trying to make a copy of the table, you can either try to find a command to run that'll dump the contents, or have your PHP script construct a SQL command from the results provided by MSSQL.

    The second thing you're asking should be fairly easy - you issue a DELETE or TRUNCATE command, then create INSERT statements from CSV and run them. PHP provides some built in functions like fgetcsv that should help you with parsing of CSV files.

    Hope this helps!


    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions