Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    202
    Rep Power
    0

    Default anybody here know how to integrate MySQL into website?

    Hi guys, i want to know if anybody here know how to integrate MySQL into website. If you know please make a tutorial here, thank you!

  2. #2
    Join Date
    Aug 2007
    Location
    Indian Suburbs
    Posts
    802
    Rep Power
    17

    Default

    akulho you will be needing tables for your MSQL database set up..do tell me if you have login and user information already prepared in your database..if you have not i can cover it here that too..

    1.so first create tables akulho if have not already created them
    2.then fill in the database as required by you in the tables
    3.use this code to now create table in your PHP which will be covering your MYSQL username and password..

    <?
    $user="username";
    $password="password";
    $database="database";
    mysql_connect(localhost,$user,$password);
    @mysql_select_db($database) or die( "Unable to select database");
    $query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
    mysql_query($query);
    mysql_close();
    ?>

    remember it is the standard table code am providing you where you can put your MYSQL username and password..
    "VARCHAR"s are for your required contact info as you might be knowing
    4.Next,you will need to issue the command to start a database connectionwith your local host)

    mysql_connect(localhost,$username,$password);

    5.before proceeding close MYSQL using this command

    mysql_close();
    6.now,select your database using this command(database containing ur username)

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

    (now i have included the die part coz its although not essential but serves to put an error control..you can leave it if you want)
    7.now you should execute the command on your webserver..check it by this command
    mysql_query($query);
    8.ALL SET..now you can insert your contact info in the databse using this command..am using your username for example:

    $query = "INSERT INTO contacts VALUES ('','akulho','ur last name','phone no.',' private number','youremailid.com','http://www.YOURWEBSITENAME.com')"

    NOW YOU CAN ADD ANY OTHER THING YOU WANT..hope it helps

  3. #3
    Join Date
    Nov 2007
    Posts
    202
    Rep Power
    0

    Default

    Thank a lot byyp, that's really helpful. I will try to setup the tabel using codes you has given here, and if something went wrong surely I know the one I would ask for help regarding this. Thanks again byyp.

Similar Threads

  1. What is MySQL???
    By sekhar4m92 in forum Scripts
    Replies: 11
    Last Post: 01-10-15, 13:11
  2. Replies: 0
    Last Post: 29-07-13, 08:38
  3. Whats The Difference Between SQL And Mysql
    By debasis in forum Scripts
    Replies: 7
    Last Post: 28-02-09, 09:34
  4. Replies: 13
    Last Post: 24-01-09, 19:35
  5. Learning MySQL
    By byyp in forum Scripts
    Replies: 21
    Last Post: 03-01-09, 09:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
webmaster forums webmaster resource forum webmaster money forums