[PHP] How to process a query form with CHECKBOX Please help
Dear group, I am a novice programmer started doing php to process a query form of my patients. I have a database and one table in it deals with my patient information. Depending on their condition I divided their age groups into 3 categories. In my database a table patient_data has a column age_group and a patient can be any one of young, middle or old category. Now the possibility is that a user can selecct 1 or 2 or all three options. In the query form, I gave the option for a user as a check box. The piece of html code is as below: Age group Young Middle Old Problem: I want to capture the user options and create an SQL statement: Select age_group from patient_data where age_group = young and old ; I am truly stuck here. Can any one please help me out to pass this situation. Thank you in advance. Kumar. __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] what is wrong with my code.. please help
Dear group, I am trying to query my db and print the results. when i execute my script, i am not getting any result except a blank page. can any one please help me what is going wrong with my script. Script: $conn = pg_connect("user = $user dbname = $dbname host = $host password = $pass"); if (!$conn) { echo('could not establish connection with database '); exit; } $sql = "select * from experiment;" $sth = pg_exec($connect,$sql) if (! $sth){ die("Can't execute query".pg_errormessage()); } for($i = 0,$j = pg_numrows($sth);$i < $j;$i++){ $ar = pg_fetch_row($sth,$i); foreach($ar as $col){ print "$col "; } print "\n"; } ?> thank you in advance kumar __ Do you Yahoo!? Send holiday email and support a worthy cause. Do good. http://celebrity.mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php