Automatic variable creation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nmb
Forum Newbie
Posts: 21
Joined: Thu Jul 20, 2006 11:08 am

Automatic variable creation

Post by nmb »

hi pp!

with the follow table from mysql

Code: Select all

id  cnfgvar              cnfgopc
1   cnf_sitetitle        Site 
2   cnf_siteurl          http://www.site.com/ 
3   cnf_siteemail        site@site.pt 
4   cnf_description      Descrição do site 
5   cnf_keywords         descrição, dos, conteúdos, do, site 
6   cnf_siteyear         2007 
7   cnf_upl_ima_max      100000 
8   cnf_timeoutseconds   600 
9   cnf_usr_cnt_snc      1157985233
is possible to create automatic php variable from a mysql query?

for ex. for the table up I want to create a loop (while) that's generate the php code:

$cnf_sitetitle = "Site ";
$cnf_siteurl = "http://www.site.com/ "
...and so on...

is this possible?

tnks pp!
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

Post by mcog_esteban »

nmb
Forum Newbie
Posts: 21
Joined: Thu Jul 20, 2006 11:08 am

Post by nmb »

it works! thanks man!
Post Reply