corkg Posted October 16, 2007 Share Posted October 16, 2007 Hi I have a query to select something from a database: $sqlquery="SELECT * FROM PVS"; while($foy=odbc_fetch_object($resultiscri)){ echo"$foy->name"; } But it gives me a list like this 1 1 2 2 3 I only want it to show 1 2 3 Link to comment https://forums.phpfreaks.com/topic/73516-just-the-one/ Share on other sites More sharing options...
trq Posted October 16, 2007 Share Posted October 16, 2007 <?php $sqlquery="SELECT * FROM PVS GROUP BY `name`"; ?> Link to comment https://forums.phpfreaks.com/topic/73516-just-the-one/#findComment-370864 Share on other sites More sharing options...
corkg Posted October 16, 2007 Author Share Posted October 16, 2007 I am afraid it does not return any results, I am using an ODBC database. This is the full code <select name="findcri" id="findcri"> <? $sqlquery="SELECT * FROM PVCDATABASEOFJOBS"; $resultiscri=odbc_exec($conexion,$sqlquery); while($foy=odbc_fetch_object($resultiscri)){ ?> <option value="<?=$foy->catagory?>"><?=$foy->catagory?></option> <? }?> </select> Link to comment https://forums.phpfreaks.com/topic/73516-just-the-one/#findComment-370879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.