close

Privacy guaranteed - Your email is not shared with anyone.

web page connection to database

Discussion in 'Tech Talk' started by bohr, Apr 18, 2006.

  1. bohr

    bohr rm -rf /

    Joined:
    Apr 11, 2003
    Messages:
    52
    Likes Received:
    0
    Location:
    FL
    Hi All,

    Do you know of any programs that I can create forms via a webpage that will allow me to connect to a database that I create? Let me explain:

    I'd like to be able to access a website and create forms (names, addresses, phone etc...) and click SAVE and have this info stored on a database server. I'd also like to be able to search the database via the website.

    I have Dreamweaver MX; can it do this?

    Sorry if my question is vague.
     
  2. Markie

    Markie Church of Mark

    Joined:
    May 12, 2000
    Messages:
    15
    Likes Received:
    0
    Location:
    VA, USA
    You will need some extra things.
    1) A database (mysql is a good free one) installed.
    2) A scripting language that talks to the database (PHP) installed.
    3) Dreamweaver will let you create the page and test it.

    http://www.freewebmasterhelp.com/tutorials/phpmysql

    Do a google with PHP and MYSQL as the search and you will get lots of returns. There are lots of good free instructions out there.

    It is not to hard to build something simple that does addresses and such, but the more complex thing you build, the more difficult it gets.

    There are also lots of free prebuilt pages and databases out there, and a huge user community.

    Good luck!
    Mark
     

  3. bohr

    bohr rm -rf /

    Joined:
    Apr 11, 2003
    Messages:
    52
    Likes Received:
    0
    Location:
    FL
    Thanks Mark,

    Can you point me to some of the free ones out there?
     
  4. prism

    prism more ammo

    Joined:
    Sep 26, 2002
    Messages:
    1,467
    Likes Received:
    42
    Location:
    Indiana
    if this is just for your own use, you could just use some free forum software. maybe make the info viewable only by yourself (when logged in).
     
  5. Markie

    Markie Church of Mark

    Joined:
    May 12, 2000
    Messages:
    15
    Likes Received:
    0
    Location:
    VA, USA
    phpNuke and phpBB are free forums and they pretty easy to setup.

    Looking at these and some sites that run off them would be a good place to start.
     
  6. David_G17

    David_G17 /\/\/\/\/\/\/\/

    Joined:
    Oct 7, 2002
    Messages:
    2,046
    Likes Received:
    0
    i spend about 5 hours a day every day doing what you are talking about doing.

    do you have your own web server?

    if not, set up Apache (free), setup MySQL (free), install PHP (free), and find a beginner's book on PHP from a local bookstore. It'll likely go over how to interact with MySQL.

    If you need any help, just ask.

    you don't need Dreamweaver, per se, but it may make developing the forms easier.


    edited to add: here's the contents of a PHP function I use to connect to a database, and insert a query:

    PHP:

    $query 
    "insert into some_table(name, address, phone) values('$_POST[name]', '$_POST[address]', '$_POST[phone]')";

    $database "name_of_your_database";
    $username "user_you_granted_permissions_to_in_mysql";
    $password "that_users_password";
    $destination "localhost"//can be an ip address if on another server


    //connect
    mysql_connect($destination$username$password) or die("Unable to connect to database: "mysql_error());

    //choose database
    mysql_select_db("$database") or die ("Unable to select database: " mysql_error());

    //submit query
    $result mysql_query($query) or die("Unable to modify database: " mysql_error());

     
  7. bohr

    bohr rm -rf /

    Joined:
    Apr 11, 2003
    Messages:
    52
    Likes Received:
    0
    Location:
    FL
    Thanks for the help and ideas.

    David_G17:

    I do have a webserver up and running. I have never worked with php before so I may be contacting you. Thanks
     
  8. Glock Bob

    Glock Bob Snack Attack!!!

    Joined:
    Aug 5, 2004
    Messages:
    405
    Likes Received:
    0
    Location:
    Alabama
    If you want to go with Apache/MySQL/PHP I'd suggest you take a look at XAMPP from Apache Friends. It is an all-in-one Apache/MySQL/PHP/ftp solution that makes it easy to get up and running in no time. You can even try it out on your own machine to get a feel for it all before you put it on your server. It helps you get your ducks in a row so you don't spend hours and hours frustrated trying to do it all yourself.