problem getting data from table

Codes here !

Moderators: egami, macek, gesf

Post Reply
howto
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Aug 28, 2017 10:40 am

Mon Aug 28, 2017 10:47 am

Hi,
table "programoptions" contains two columns optionname and optionvalue. Optionname is primary key.
For example:

directory | programs\test\
background | white.jpg
width | 640
height | 320

How to get this data from database for using in assoc table like:
print $options['height'];
for getting 320 in result?

howto
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Aug 28, 2017 10:40 am

Mon Aug 28, 2017 3:10 pm

Just found. For descendants:

Code: Select all

while ($row = db_fetch_array($result)) {
   $webapp_settings[$row['optionname']] = $row['optionvalue'];
}

Post Reply