#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    I'm am just beginning to learn PHP and MySQL. My web host does not allow telnet access, so I am trying to find a php script or something that will let me edit my database through my browser. Does anyone know of anything?

    Thanks

    Colby Smith
  2. #2
  3. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    17
    I have the same problem with our main company webhost at work. If you write a PHP script using the $query = "MYSQL STUFF HERE"; then you can execute commands. First of all, you must connect to the database, like this:

    MYSQL_CONNECT(localhost,username,password) OR DIE("Unable to connect to database");

    then you have to tell it which database to use:

    @mysql_select_db("database_name") or die("Unable to select database");

    After that, you can put database commands inside a $query, like:

    $query = "INSERT INTO database VALUES ('Alex', 'http://www.alex-greg.co.uk')";

    After you've finished with your database, you have to close your database connection, like so:

    MYSQL_CLOSE();

    So a complete database script might look like this:

    <?

    MYSQL_CONNECT(localhost,username,password) OR DIE("Unable to connect to database");

    @mysql_select_db("database") or die("Unable to select database");

    $query = "INSERT INTO table VALUES ('$name','$email')";

    MYSQL_CLOSE();

    ?>

    Any more questions, feel free to ask

Similar Threads

  1. Check MySQL Version thru PHP
    By wolftrap1 in forum PHP Development
    Replies: 2
    Last Post: February 11th, 2004, 09:51 PM
  2. Replies: 0
    Last Post: February 11th, 2004, 12:44 AM
  3. Replies: 0
    Last Post: January 30th, 2004, 02:22 PM
  4. PHP 5 (MYSQL vs. SQLite)
    By ignition in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 01:13 PM
  5. PHP Reconfig with mysql...
    By Legendary Fox in forum PHP Development
    Replies: 3
    Last Post: January 23rd, 2004, 12:46 AM

IMN logo majestic logo threadwatch logo seochat tools logo