SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: form fields

  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Grimsby
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form fields

    ok this is really bugging me now,

    I have a form, I want to join the three of the form fields together to insert into my database. Is this possible?

    thanks,
    Darren

  2. #2
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by "join" them? Don't you have three separate fields in your database for this data?
    John

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Grimsby
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no I'm probably going the wrong way about but i want to add the date for a football fixture to the databse so have created three select boxes for the day month and year, i wanted to then use something like this to insert them

    Code:
    $DATE = $_POST['year'.'day'.'month'];
    the form uses the php self function and obviously I use the variable $Date to add it to the database. I couldn't think of a dif way of doing this, actually just thinking about it I should use three seperate fields in my databse for the day, month and year and then when retrieving the fixture list I can join the string?

  4. #4
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Grimsby
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you have a look at my site particularly this bit: http://www.thehurricanesft.co.uk/fixtures.php

    at the mo the site is all updated by hand I am currently modifying it and want all the sections to be database driven allowing the adding, editing and deleting of content. I'm getting there but with my limited knowledge the fixtures section as been a pain.

  5. #5
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could do it this way:
    $date = $_POST['year'].'-'.$_POST['day'].'-'.$_POST['month'];

    It would produce: $date = '2003-27-05';

    Is that what you are looking for?
    John

  6. #6
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Grimsby
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    exactly thanks, I do i needed to join the strings using dots but got it a bit wrong.

    thanks again,
    Darren

  7. #7
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem.
    John


Bookmarks

Posting Permissions

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