Re: $ of variables, php, mysql
| From: | Marek Kilimajer | Date: | Tue, 25 Nov 2003 10:38:27 +0000 |
| Subject: | Re: $ of variables, php, mysql | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170865@lists.php.net to get a copy of this message | ||
Eugene Lee wrote:
Try using more variables to make life a little easier to parse: $colname = $_FORM['form'] $query = "select {$colname} from structure"; $result = mysql_query($query); while (($row = mysql_fetch_array($result)) !== false) {Very dangerous. $colname can be anything, e.g. "mysql.user.password colname FROM mysql.user #"echo $row[$colname];}