Pass Value of Radio Buttons through SQL Query
I am very new to both PHP and MySQL. I have a MySQL database that includes a field called "max_rooms" with the values 1 or 2 set for each row in the database it applies to. In my HTML document, I have a form containing a question named "max_rooms" with two choices that are radio buttons. My PHP and MySQL are connected properly; I just don't know what to write in the form results PHP document so that the values are passed correctly. I think it might be something like the following, but I'm not sure and anyway don't know what to do after that:
$sqlquery = "SELECT * FROM hallonly";
$sqlquery .=" where max_rooms = $_POST['max_rooms']";
Your form with radio buttons:
Thanks much; I finally figured it out.
|All times are GMT +1. The time now is 06:17 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.