Results 1 to 3 of 3

Thread: Simple database

  1. #1
    Join Date
    Jun 2004
    Posts
    1

    Unanswered: Simple database

    I am trying to create a simple table so people can enter their details and submit on my site, please help me on a simple way to do it, i want to use mysql and am still new to it

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    Check out this basic tutorial on php and mysql and inputting from a form

    http://hotwired.lycos.com/webmonkey/...tutorial4.html

  3. #3
    Join Date
    Sep 2003
    Location
    So. Cal. USA
    Posts
    142
    Hi, munazip! I am new as well and am in the middle of my first project. MySQL is a database, but if you want website visitors to submit information to it, you will need to use a middleware scripting language like PHP to submit your data to the db. PHP is not the only option, but it is a popular one and the one I have chosen.

    This is what I have found thus far, but I am still not done so have more to learn...

    You, as a user, can interact with the db by issuing SQL commands from the commandline application but from the web, you can use PHP to generate/compose the SQL commands and store them as string variables and then send the string to MySQL using PHP mysql_... functions.

    In your case, all you want is a form submission, so you would create a web form as usual and then put PHP scripting in your HTML with the PHP tags <? ... ?> to (1) connect to the mysql db, (2) compose the SQL query to insert your data, and (3) send the SQL command.

    If you wanted to show a confirmation of the data just entered, you would perform steps 1-3 again on the confirmation page, but you could send an index ID variable as a POST or GET value and your SQL query would be more about reading data and loading data into PHP variables you could then show to users (e.g.

    print ("Name you entered : " . $name);

    I would suggest you search for an easy step-by-step tutorial... there are many out there. I find that PHP seems to be somewhat flexible so I notice programming style more than I thought I would. I'm developing my own style based on my old programming habits (e.g. most folks would omit the parentheses I have above but since I am learning, I included them to remind me what the function applies to and to remind me to put a ; at the end).

    If you have no programming experience, you can probably muddle your way through it but it will be much more challenging. "Little" things like syntax and punctuation will stop the whole thing ( a missing ; or { or something out of sequence, etc.).

    Good luck!
    --ST

Posting Permissions

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