English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm puting data from mysql database to an optionbox....

I'm using this code:




$con = mysql_connect("localhost","Adm...

mysql_select_db("sciencelist", $con);

$result = mysql_query("SELECT DISTINCT(mainbranch) FROM websites");

while($row = mysql_fetch_array($result))
{
echo "";
}

?>


USE "SELECT DISTINCT(mainbranch) FROM websites" query
Got it (onlykeshu@yahoo.co.in)

2006-07-16 22:54:54 · answer #1 · answered by keshu 2 · 0 0

mysql select sintax:

SELECT
[ALL | DISTINCT | DISTINCTROW ]
....

The ALL, DISTINCT, and DISTINCTROW options specify whether duplicate rows should be returned. If none of these options are given, the default is ALL (all matching rows are returned). DISTINCT and DISTINCTROW are synonyms and specify that duplicate rows in the result set should be removed.

2006-07-16 07:56:25 · answer #2 · answered by Deep Thought 5 · 0 0

modify your sql query to read:

select top 1 from websites order by

2006-07-16 07:58:41 · answer #3 · answered by Ivanhoe Fats 6 · 0 0

fedest.com, questions and answers