+ Reply to Thread
Results 1 to 5 of 5

Thread: PHP varaible question

  1. #1
    thenewprogrammer is offline x10Hosting Member thenewprogrammer is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    45

    PHP varaible question

    Having problems trying to get 3 differnt values into one field(birthday,birthmonth,birthyear)

    found out i cant assign more than one value to variable like this
    and wondering if and how i can set this into array. this outputs nothing and when i give them differnt varables and try to put it into same field only the first one shows.

    Code:
    $birthday=strip_tags($_POST['birthday']);
               $birthday=strip_tags($_POST['birthmonth']);
               $birthday=strip_tags($_POST['birthyear']);
     
    $sql="INSERT INTO temp SET code='$confirm_code',user_name='$name',user_email='$email',user_password='$pass', user_gender='$gender',user_birthday='$birthday'";
        $result=mysql_query($sql);
    Last edited by thenewprogrammer; 07-29-2009 at 06:51 PM.

  2. #2
    lmstfy is offline x10Hosting Member lmstfy is an unknown quantity at this point
    Join Date
    Jul 2009
    Location
    Inside Stoli.x10Hosting.com
    Posts
    18

    Re: PHP varaible question

    Code:
    $birthday = strip_tags($_POST['birthday']) . strip_tags($_POST['birthmonth']) . strip_tags($_POST['birthyear']);

  3. #3
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: PHP varaible question

    1. Am I right in assuming user_birthday is text and not a Date field?

    2. Are the fields from the form all numerals? In that case, you might want to put a space or slash between them when you combine them using lmstfy's code. Otherwise 1111988 can be formed by 1 11 1988 or by 11 1 1988. If you are using zero padded days/months, then you don't have to. Also, if you are using the month spelled out, it is not necessary.

  4. #4
    zapzack is offline x10 Elder zapzack is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    606

    Re: PHP varaible question

    He didn't note it here, but he already solved his issue..

  5. #5
    thenewprogrammer is offline x10Hosting Member thenewprogrammer is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    45

    Re: PHP varaible question

    Quote Originally Posted by zapzack View Post
    He didn't note it here, but he already solved his issue..
    yup sorry forgot to say it. problem soleved ;)

+ Reply to Thread

Similar Threads

  1. Places to learn php
    By JaWasabi in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 01-13-2009, 02:03 AM
  2. PHP Upgrade Question.
    By otakuhot in forum Free Hosting
    Replies: 3
    Last Post: 05-03-2008, 05:55 PM
  3. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  4. hi, php related question
    By lethologica in forum Free Hosting
    Replies: 2
    Last Post: 11-17-2007, 02:33 PM
  5. PHP Question
    By Zenax in forum Scripts & 3rd Party Apps
    Replies: 6
    Last Post: 11-10-2006, 09:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers