Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    6

    Unanswered: PHP form to show one-to-many relationships from DB

    I am trying to figure out what I hope is simple -- but haven't grasped yet. I am looking for recommended books and online tutorials if the answer is too long or complex for this forum.

    I would like an online FORM that can take the following:
    Name
    Fax Number
    Hm Phone Number
    Wk Phone Number (and extension)
    Cell Phone Number

    I want the submit button to automatically place these records into the correct mySQL tables -- tblName, tblPhone, tblPhoneType.

    I know Access okay -- but I want this to be an online simple form with a good DB backend. I want to learn PHP/mySQL -- but am not sure where to begin.

    Thanks in advance....

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I think that this form is not he right place to be asking for complete lesson on PHP & MySQL...

    traditonally PHP is used in web applications, in the form of scripts that run on a server and send information back to the user as HTML. Not every script needs an input or and output, obvously it would be fairly pointeless if there was no output AND no input, although there asom circumstances where you might choose to do that.

    you will probably need 2 scripts one to handle the user interface (contiang a form, within that all the input boxes you need etc)
    efectively swcripts are giiant functions with parameters passed using <urlname>?param1=parm1value&param2=parm2value....p aramx=parmxvalue
    when you declare your input boxes use something like
    <input type=\"text\" name=\"pName\" maxlength=\"30\" size=\"30\" value=\"$pName\">

    in this instance Ive decared an input box called pName (the pName is my convention so that I know what are parameters), the value=\"$pName\" tells the script to put any value in the PHP variable $pName into that box. you may want to use this if say someone put in inval;id data elsewhere and you want the user to revisit the data entry form. the \" is PHP's way of escaping the double quote which it uses as a string delimiter

    have a look at the PHP site, especially the FAQ.

    WWGS (what would google say). of these the W3schools & rutgers references may be of use.

    Id also have a look at some fundamental lessons on database design, as I think your desin is a little odd

    I'd consider downloading an editor like Chamisofts HTML Kit, although all you need for web development is a text editor

    The validation script shoul validate any incoming data, making sure that it contains only acceptable input. you may have a business rule that inisists you must have a phone number AND a name. for that you need to have 1) created your db and 2) know how to access the db have look at the references above, and any other suggestions form contributors and try to come up with a few ideas (examples) of what you have done, and try to make the answer to your questions easy to follow. You may care to look at the Access Thread on this forum, especially the FAQ

    Most people on these threads will try to help, but they wont do it all for you.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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