PHP scripts using CL

Sharky Forums


Results 1 to 3 of 3

Thread: PHP scripts using CL

  1. #1
    Sushi
    Join Date
    Aug 2007
    Posts
    1

    PHP scripts using CL

    Hi All,

    I have this scenario, hopefully it can be possible to implement it in php scripting using command line.

    I have a datatbase (MySQL) to connect.

    By using command prompt:
    - So i would like to have a php script to connect to my mysql, and it says it's connected successfully...(i have this code done) additionally, I want this script to allow the end user to enter his/her own database name...be able to create a name which will automatically be generated into mysql. Another script to drop the database ?????? and also give options to user....do you really want to delete or drop ...????
    Can both php (connect & create name) be in the same script? how?

    Once that's done, the user must be able also to connect through command prompt to a URL, in order to retrieve data and store them into mysql.

    Can I find some sample working codes to illustrate all?

    Hope to get your comments soooooonnnnn...
    thanks a lot for reading....

  2. #2
    Hammerhead Shark benneke's Avatar
    Join Date
    Aug 2001
    Location
    antwerp
    Posts
    1,531
    i'm not sure if it's possible to run php script on a command line. I dont even want to know why you'd want to do this.

    i think you need another programming language to achieve what you want.
    Perhaps you should use Perl or java (my best bet will be java, because i think its more accessable for people who want to start programming)

    what you say, is very much possible to implement in java using JDBC (java database connection).

    To create/drop/alter a database is possible to execute in java/perl/php if you use a DDL (Data Definition Language) syntax query that is in the mysql-dialect

  3. #3
    Cartoon Shark jester22c's Avatar
    Join Date
    May 2001
    Location
    between my headphones
    Posts
    4,372
    Here is an example of a simple Perl script to connect and query a database. Google has plenty more where that came from.
    #Download Firefox# Playing: TF2
    [Main Rig]
    [EVGA P55 SLI] [i7 860 @ 3.6] [Cooler Master Hyper 212 Plus] [8GB Corsair DDR3 1600]
    [Intel G2 80GB SSD] [MSI GTX260 OC] [NEC ea231wmi] [X-Fi > Z-Audio Lambda > Senn HD-580s]

    [Server]
    [MSI K8N Neo4 SLI] [Opteron 175 @ 2.9] [TT Big Typhoon] [2GB Corsair DDR]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •