Forum Moderators: coopster
The SQL i want to run on submit is
select competition_entry.competition_id, user.user_id, email_address,
first_name, last_name, gender, date_of_birth, telephone_number,
address1, address2, address3, town, county, postcode
from competition_entry, user
WHERE competition_entry.competition_id ='#*$!#*$!#*$!'
ORDER BY RAND() limit 1\G
The #*$!#*$!xx is replaced by the string selected in the drop down menu i made
<option value ="<?=$row['id'];?>"><?=$row['name'];?> </option>
so .competion_id should be $row['id']?
I then want to echo the result. If submit is pushed again, i want the script to run again.
cheers for any help.
you might want to take a look at this library thread as it pertains to your question and should help you along to solution: basics of extracting data from mysql [webmasterworld.com]. Other than this, the mysql functions [php.net] are another great place to look for information.
Just a security note: Make sure to clean the input data appropriately for what you need it for, and properly escape the data before inserting it into a query string. To do this, it is best to use mysql_real_escape_string [php.net].
good luck :)