astani Posted September 15, 2008 Share Posted September 15, 2008 Hi, I am a php newbe I have a Posgresql db and am trying to do a sort routine based on project titles or project owners. I have an html dropdown for this. I have an array that displays the letters of the alphabet and would like to be able to pick from the dropdown and populate the names of projects alphabetically or names of projects by creator. Here is what I have so far, the queries don't seem to work or maybe just not displaying, any help would be apreciated. <h4 align="left">Sort By: </h4> <form name="jump"> <p align="left"> <select name="menu"> <option value="URL"> Project Name</option> <option value="URL"> Owner</option> </select> <?php $sort_query = pg_query("SELECT * FROM projects ORDER BY title"); $projByTitle = pg_fetch_array($sort_query); $sort_query1 = pg_query("SELECT * FROM users ORDER BY username"); $projByOwner = pg_fetch_array($sort_query1); ?> <input type="button" name="<?php if (jump.menu.selectedIndex == "0") { echo "$projByTitle"; } else { echo "$projByOwner"; } ?> " method = "post" value="GO"> Thanks, Andy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.