note 28208 added to function.eval

From: Date: Mon, 06 Jan 2003 09:21:18 +0000
Subject: note 28208 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-41713@lists.php.net to get a copy of this message
This code retrieves the settings from a table called mwa_settings. This table contains the fields setting_name (varchar 50) and setting_value (varchar 50). <?php $mydb2 = @mysql_connect("localhost", "", ""); @mysql_select_db("MWA",$mydb2); $Q_sql="SELECT setting_name,setting_value FROM mwa_settings"; $result = mysql_query($Q_sql, $mydb2); while($row = mysql_fetch_row($result)) { eval ("\$".$row[0]." = \"".$row[1]."\";"); } ?> -- http://www.php.net/manual/en/function.eval.php http://master.php.net/manage/user-notes.php?action=edit+28208 http://master.php.net/manage/user-notes.php?action=delete+28208 http://master.php.net/manage/user-notes.php?action=reject+28208

« previous php.notes (#41713) next »