Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Posting variable data into MySQL database

    Ok, I hope I can explain what I am trying to do.

    I have a form on my page with a few fields. For example reasons lets say one field is "FIRSTNAME" and the other is "LASTNAME" when my page is processed it take these two fields and make these two into one word "FIRSTNAMELASTNAME" I have a this data sent to variable ($names = FISTNAMELASTNAME).

    How can I get this to post into my database from the variable so my insert will be "FIRSTNAMELASTNAME"

    I have already established my database connection. I can get data from other forms fields directly into the database. So I guess what I am asking is how can I post the data from my varibale $names. What would be the correct line of code for it.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    PHP Code:
    $data $_POST['FIRSTNAME'] . $_POST['LASTNAME']; 

  • #3
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do not understand what "$data" is. They way I have it setup is my 2 fields get put together like so "John_Doe" and it make my variable $name = John_Doe

    How can I post just the result and make $name get posted into my database

    would it be:

    $_POST['$name']


  •  

    Posting Permissions

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