Results 1 to 5 of 5

Thread: variables

  1. #1
    Join Date
    May 2004
    Posts
    11

    Arrow Unanswered: variables


    Is it possible to take three seperate variables and combine them into one long variable?

    ie. $first = 1
    $second = 2
    $third = 3
    $combine = $first $second $third

    $combine now equals: 123.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    mysql doesn't have variables

    should you perhaps be asking this in the php forum?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2004
    Posts
    11

    You are right

    You are right, sorry

  4. #4
    Join Date
    Sep 2003
    Location
    So. Cal. USA
    Posts
    142
    $combine = $first . $second . $third;

    string concatenation using dots

    (I'm answering here since the Q was not posted in the PHP forums and someone out there may be going, "Doh! But what's the answer?")

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    thanks, steve

    i woulda done the same myself but i don't know php, not even enough to know about the dots (although, now that you mention it, i suppose i have seen it around...)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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