Jump to content


Photo

creating variables from row returns


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 06 July 2006 - 11:44 AM

if a query has this for the row return:

$row['Column1'] etc...

is there a way to create a variable not with the value of Column1, but so the $var contains "Column1" as the value...

i.e.
I would want $var=="Column1" to be true...

Hope that makes sense...

#2 CheesierAngel

CheesierAngel
  • Members
  • PipPipPip
  • Advanced Member
  • 105 posts
  • LocationBelgium

Posted 06 July 2006 - 11:49 AM

You can use the php function key() to do things like this.

<a href="http://be.php.net/ma...ion.key.php</a>

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 06 July 2006 - 11:54 AM

You can also use the function extract(). http://www.php.net/extract

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users