Jump to content

Seriously Need Help ASAP


SulleyMonstersInc

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/118137-seriously-need-help-asap/
Share on other sites


$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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.