Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MySql Fields

  • 15-01-2008 01:38PM
    #1
    Registered Users, Registered Users 2 Posts: 314 ✭✭


    Hi I was just wondering what part of the code will be used for naming a field when making the SQL database?

    <tr>
    <td>First Name:</td>
    <td><input name="first name" id="first name" size="40" /></td>
    </tr>

    Is it by any chance id?

    I'm making a form that when the user inputs their information it will send to the MySql database.

    thanks for any help.


Comments

  • Closed Accounts Posts: 583 ✭✭✭monkey tennis


    It entirely depends on the backend script/program, but it would be common to use the input 'name' field to name the database field. The 'id' field is used for CSS, I don't think it has any bearing on form input.

    The only way to know for sure which field the input is entered into is to inspect the backend code.


  • Registered Users, Registered Users 2 Posts: 1,127 ✭✭✭smcelhinney


    Its the "name" attribute thats added to request headers when passing to backend code (for most programming languages). Think client-side scripting is the only language that can take id attributes? Correct me if Im wrong.

    As good programming practice, you should probably call these the same thing anyway, cant see any reason why you wouldnt?


Advertisement