Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.