View Single Post
Old 11-21-2012, 03:52 AM   PM User | #1
chavad
New to the CF scene

 
Join Date: Oct 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
chavad is an unknown quantity at this point
Pass Value of Radio Buttons through SQL Query

Dear Everyone,

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']";

Thanks!!
Chava
chavad is offline   Reply With Quote