Re: RE: Re: [PHP-DB] mysql's enum type used with php/html form?

From: Date: Wed, 24 May 2000 14:03:54 +0000
Subject: Re: RE: Re: [PHP-DB] mysql's enum type used with php/html form?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-430@lists.php.net to get a copy of this message
You're exactly right -- I was not clear in my first message.... My difficulty is in inserting or updating the record, not in viewing it.... I have the field defined as enum in mySQL and I need to insert it ... I have the HTML code written so that the pulldown list works properly, but I have not been able to get the selection to insert into the database. Any ideas? Or better yet, could anyone simply point me to a code sample? Thanks to everyone. Kenn ----- Original Message ----- From: <M.vanderMerwe@expro.shell.co.uk> To: <php-general@lists.php.net> Sent: Wednesday, May 24, 2000 8:38 AM Subject: [PHP-GENERAL] RE: Re: [PHP-DB] mysql's enum type used with php/html form? > I don't think he had the same question. He's question was more about > once you have the value in the enum dropdown, how to update or insert > the record in the particular table he wants to update. > > In any case, the answer to my question seems to have been answered the > easiest by this answer: > > From: maxwell.hung [maxwell_hung@yahoo.com] > > $result = mysql_query("SHOW COLUMNS FROM main LIKE 'subject'"); > > while ($answer = mysql_fetch_array($result)) > { > // Grab everything between the first > // and last single quote, exclusive > ereg( "('(.*)')", $answer[1], $temp ); > // Explode on the inner " ',' " combination > $array = explode( "','", $temp[2] ); > > while (list ($key, $val) = each ($array)) > { > echo "<option value=\"$val\">$val</option>\n"; > } > } > > > > Thanks again for everyone who answered this question. i tried all, but > this seemed to do the trick easiest. > > Thys > > ---------------------------------------------------------------------------- ---- > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#430) next »