note 62815 added to function.mysql-query

From: Date: Fri, 10 Mar 2006 10:07:48 +0000
Subject: note 62815 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-105181@lists.php.net to get a copy of this message
Another shorter possibility to print options of an ENUM as <select>-tag: <?php $result=mysql_query('SHOW COLUMNS FROM <your table> WHERE field=\'<you column>\''); while ($row=mysql_fetch_row($result)) { foreach(explode("','",substr($row[1],6,-2)) as $v) { print("<option>$v</option>"); } } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 71.193.195.41 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-query.php Edit -- http://master.php.net/note/edit/62815 Del: integrated -- http://master.php.net/note/delete/62815/integrated Del: useless -- http://master.php.net/note/delete/62815/useless Del: bad code -- http://master.php.net/note/delete/62815/bad+code Del: spam -- http://master.php.net/note/delete/62815/spam Del: non-english -- http://master.php.net/note/delete/62815/non-english Del: in docs -- http://master.php.net/note/delete/62815/in+docs Del: other reasons-- http://master.php.net/note/delete/62815 Reject -- http://master.php.net/note/reject/62815 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#105181) next »