Passing params to system()

Discussion in 'PHP' started by SGBoise, Apr 2, 2009.

  1. #1
    Hey guys,

    I'm trying to figure out a way to pass parameters after a command has been executed.

    Basically I want to run a mysql command to import a large sql file within php just in case the web host doesn't allow ssh access. The only problem is that mysql command prompts for password plus you have to press enter after you type in the password.

    Is there anyway to do this? :D
     
    SGBoise, Apr 2, 2009 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can put the password on the command line with mysql:

    mysql --password=scalawag -u marvin -e 'select * from pantaloons' hosierydb
     
    SmallPotatoes, Apr 3, 2009 IP
    SGBoise likes this.
  3. SGBoise

    SGBoise Peon

    Messages:
    647
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Great. Thank for your help.
     
    SGBoise, Apr 3, 2009 IP