User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » php eval() problem Page [1]  
GiZZ
All American
6982 Posts
user info
edit post

I guess maybe eval isn't even the right thing to do here... but i am having trouble getting my brain around this this morning.

Basically I have a database field that holds the name of a variable. so when i do a query i get this:

$data[value] is a string that contains "$variable_a" (the variable name) as text. I want $data[value] to actually hold the value of $variable_a, rather than $variable_a as a string. I can't get it to work. Any thoughts?

9/2/2005 12:45:55 PM

GiZZ
All American
6982 Posts
user info
edit post

$fieldvalue == "$value"
and
$value == 5

i want $fieldvalue == 5

9/2/2005 1:02:59 PM

Stein
All American
19842 Posts
user info
edit post

http://www.php.net/manual/en/language.variables.variable.php

RTFM

9/2/2005 2:11:32 PM

GiZZ
All American
6982 Posts
user info
edit post

yeah ive been reading that all day.

9/2/2005 2:49:47 PM

GiZZ
All American
6982 Posts
user info
edit post

had to do this

$fieldvalue = eval("return \$$fieldvalue;");

9/2/2005 3:06:20 PM

30thAnnZ
Suspended
31803 Posts
user info
edit post

n00b

9/2/2005 3:47:23 PM

 Message Boards » Tech Talk » php eval() problem Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.