Re: How can I get just one row from selected column?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: How can I get just one row from selected column?

From: Hilarion <hilarion@SPAM.op.SMIECI.pl>
Date: Fri Dec 30 2005 - 13:31:49 CET

>> while($wiersz=mysql_fetch_array($wynik,MYSQL_ASSOC))
>> {
>> echo "<option value=$wiersz>$wiersz</option> <br />";
>> }
>
> Try something like
>
> $value = $wiersz[$kolumna];
> echo "<option value='$value'>$value</option> <br />";
>
> (remember to enclose the value parameter of the <option> tag in quotes, or
> your XHTML code will be invalid)

To make sure it's valid, you should also use "htmlspecialchars"
function (if you use double-quotes around attribute values,
then you do not have to specify the second parameter for this function,
but if you use single-quotes - as in the example above - then you
should specify that "htmlspecialchars" should also escape single-quotes).

Hilarion
Received on Tue Jan 3 03:50:17 2006