Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 07-29-2005, 04:28 PM
Leader of Men's Avatar
Leader of Men Leader of Men is offline
Senior Member
Join Date: 10-12-03
Location: Minnesota, USA
Posts: 939
iTrader: 0 / 0%
Only one of each...

So I have a bunch of stuff in a database that I'm drawing with PHP into a form. Here is my code

$result2 = mysql_query("SELECT make FROM $type"); echo "Make: "; while ($row = mysql_fetch_array($result2, MYSQL_ASSOC)) { printf("<option value=\"%s\">%s ", $row["make"], $row["make"]); } echo '</select><input type="submit" value="Next Step"></form>';
Which works great, EXCEPT the data it is returning contains things like

So it's returning all these and I only want one of each of them... Of course, I could just manually enter every make of car ever, but that's no fun
Reply With Quote



Old 07-29-2005, 05:53 PM
imaginemn's Avatar
imaginemn imaginemn is offline
v7n Mentor
Join Date: 02-18-04
Location: Brownsville, Texas
Posts: 1,354
iTrader: 0 / 0%
Have you tried SELECT DISTINCT make FROM $type?

Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 11:36 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC