[Phplib-users] DB putting results to strings
Brought to you by:
nhruby,
richardarcher
|
From: Stefan M. <me...@me...> - 2002-08-09 10:37:44
|
Hello,
donno if this is still possible with current version of PHPLib or
maybe an idea for the future. Can I automatically put a database
value into a string named after the column where the value belongs
to?
Example:
$db=new DB_Example;
$query="SELECT * FROM exampleDB WHERE testID='test'";
$db->query($query);
while ($db->next_record()) {
$$active_column_name=$db1->f("active_column_value");
}
The old version was:
$db=new DB_Example;
$query="SELECT * FROM exampleDB WHERE testID='test'";
$db->query($query);
while ($db->next_record()) {
$column_name1=$db->f("column_value1");
$column_name2>=$db->f("column_value2);
$column_name3=$db->f("column_value3");
[...]
}
Any thoughts about it?
Thanks and greetings,
Stefan
|