www.webdeveloper.com
Results 1 to 4 of 4

Thread: dynamic column query mysql

  1. #1
    Join Date
    Nov 2010
    Posts
    56

    dynamic column query mysql

    Hey all,

    I am trying to make a script where I can query for a column that changes depending on a passed variable. So I have a variable passed called division, lets say it will be a, b, c or d.. I want to get the value in the column division_value1. I initially tried:
    PHP Code:
    $row mysql_fetch_array($query)
    $result $row[$division 'value1'
    but it didn't work and I feel it's probably not what I should be trying.. Any suggestions would be appreciated

  2. #2
    Join Date
    Mar 2014
    Posts
    1
    I realize this is 4 years old but I am trying the same thing, did you ever get an answer?

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,359
    Well, it looks like the OP left out the underscore, but I have no idea if that has anything to do with your problem (or was, in fact, his only problem). I'd suggest posting some details and showing us what code you have tried so far?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Nov 2010
    Posts
    56
    Quote Originally Posted by mikednnz View Post
    I realize this is 4 years old but I am trying the same thing, did you ever get an answer?
    Hey - I don't know if I solved it (sorry) - I think I may have just pulled all columns then compared them in php since there wasn't that many to go through..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles