Marquez Design said the following on 11/18/2005 04:54 PM:
Greetings.
Does anyone know how to do this?
I have,
$var
$var2
In a field called two_vars in a MySQL db.
I am calling the variables inside PHP document.
In that document I am saying:
$var = time
$var2 = clock
!-- I do the query
Ben wrote:
If I understand your question properly I'd explode $two_vars with
whatever seperator you have between them and then you'll need to use
eval to get your results. Maybe something like...
$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
Jasper Bryant-Greene wrote:
Ben wrote:
$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
$eval=\$temp=.$value.;;
eval($eval);
echo $temp;
}
WTF do you need eval() for?!
$dbVars = explode( ',', $two_vars );
foreach( $dbVars as $value
3 matches
Mail list logo