SulleyMonstersInc Posted August 4, 2008 Share Posted August 4, 2008 I created a form that will email information already but the only thing i need help with is a database search I have a list of names i am putting into the database and i want people to do a search for there name and a button with Decline or Accept and then the email form will kick in I just need help with the database search can someone please help me i need this done asap this is for my friends wedding Quote Link to comment https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/ Share on other sites More sharing options...
budimir Posted August 4, 2008 Share Posted August 4, 2008 Post some code and we will help you... Quote Link to comment https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/#findComment-607787 Share on other sites More sharing options...
MatthewJ Posted August 4, 2008 Share Posted August 4, 2008 $cxn = mysql_connect('host', 'user', 'pass') or die (mysql_error()); mysql_select_db('yourdb', $cxn); $sql = "SELECT * FROM yourguesttable"; $res = mysql_query($sql, $cxn); $row = mysql_fetch_assoc($res); echo "<form name=\"getuser\" value=\"yourformpage.php\" method=\"get\">"; echo "<select name=\"guests\">"; do { echo "<option value=\"$row['recordid']\">$row['name']</select>"; } while($row = mysql_fetch_assoc($res)); echo "</select>"; echo "</form>"; That is the bare bones to generate the select menu from the database. Just change the values to your own and set the form action to go to the email page and use $_GET['guests'] to get the value from the URL. Hope that helps get you going Quote Link to comment https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/#findComment-607829 Share on other sites More sharing options...
SulleyMonstersInc Posted August 5, 2008 Author Share Posted August 5, 2008 all the code i have does not connect me to a database its just a simple email form i have no code to connect me or nothing here is a little more information all the names will be entered befor hand and when they search there name if nothing comes up that means there where not invited when they search there name and it comes up it will come up with a accept or decline button i dont really need the database to be updated because if the accept or decline it will be sent to me as an email so i will know not needing the database to be update all i need from the database is for it to hold the names so when people search it there name will pop up Quote Link to comment https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/#findComment-608085 Share on other sites More sharing options...
revraz Posted August 5, 2008 Share Posted August 5, 2008 Google on how to use php and mysql together. Quote Link to comment https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/#findComment-608091 Share on other sites More sharing options...
SulleyMonstersInc Posted August 5, 2008 Author Share Posted August 5, 2008 i did thats what brought me here Quote Link to comment https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/#findComment-608880 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.