| | |
Multiple text box query
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi,
I posted this in the MySQL forum and after 3 days without any help I thought I might have it posted in the wrong forum so I am posting it here.
I am trying to query a terms database with multiple text boxes. The user has a choice of how many text boxes they want (i have this part done), they would put one term into each text box. The would have the option of checking a check box for pronunciation, date of origin, etc. These check boxes when checked would search all terms in the text boxes and return the data if available along with the definitions of each term. The definitions for each term will be listed as 1, 2, 3, etc. the output should look like this:
House (term)
1. A building for human habitation.
2. A shelter for an animal
3. A building where something is stored.
However, each of the numbered definitions should have a check box to the left and when checked and submitted will show another page with the results of the checked boxes as well as the term.
I am having difficulty getting past the select the number of word boxes. I don't seem to be able to get the query to work for the search.
Can anyone help with the type of query or script help that I would need to make.
Thanks,
ac
I posted this in the MySQL forum and after 3 days without any help I thought I might have it posted in the wrong forum so I am posting it here.
I am trying to query a terms database with multiple text boxes. The user has a choice of how many text boxes they want (i have this part done), they would put one term into each text box. The would have the option of checking a check box for pronunciation, date of origin, etc. These check boxes when checked would search all terms in the text boxes and return the data if available along with the definitions of each term. The definitions for each term will be listed as 1, 2, 3, etc. the output should look like this:
House (term)
1. A building for human habitation.
2. A shelter for an animal
3. A building where something is stored.
However, each of the numbered definitions should have a check box to the left and when checked and submitted will show another page with the results of the checked boxes as well as the term.
I am having difficulty getting past the select the number of word boxes. I don't seem to be able to get the query to work for the search.
Can anyone help with the type of query or script help that I would need to make.
Thanks,
ac
Although I don't 100% understand what you are requesting, I shall give you a script which shows how displaying the results. This however takes the knowledge of mysql querys, php and html lists.
So the above will show you the basics of displaying the result and hopefully give you enough to help answer some of the questions. Also note that the html side of the lists in the script may not be accurate and the variables will need adjusting to what they are set in your current page/mysql database.
php Syntax (Toggle Plain Text)
//$_POST['term1'] is first posted search variable //$_POST['term2'] is second posted search variable //$_POST['term3'] is third posted search variable $resulta=mysql_query("SELECT * FROM `tablename` WHERE `term`='".$_POST['term1']."'"); echo "<ol>The term is: ".$_POST['term1']."<br>"; while ($rowa=mysql_fetch_array($resulta)) { echo "<li type='1'>".$rowa['definition_column_name']; //html li might be different } echo "</ol>"; $resultb=mysql_query("SELECT * FROM `tablename` WHERE `term`='".$_POST['term2']."'"); echo "<ol>The term is: ".$_POST['term2']."<br>"; while ($rowb=mysql_fetch_array($resultb)) { echo "<li type='1'>".$rowb['definition_column_name']; //html li might be different } echo "</ol>"; $resultc=mysql_query("SELECT * FROM `tablename` WHERE `term`='".$_POST['term2']."'"); echo "<ol>The term is: ".$_POST['term2']."<br>"; while ($rowc=mysql_fetch_array($resultc)) { echo "<li type='1'>".$rowc['definition_column_name']; //html li might be different } echo "</ol>";
So the above will show you the basics of displaying the result and hopefully give you enough to help answer some of the questions. Also note that the html side of the lists in the script may not be accurate and the variables will need adjusting to what they are set in your current page/mysql database.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. - MacGyver Fan
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` My favourite PC. - MacGyver Fan
![]() |
Similar Threads
- Form submit with weird select box result (HTML and CSS)
- Populating Multiple Text Fields Based On A Dynamic Drop-Down List Selection (PHP)
- multiple search terms+fulltext search (MySQL)
- Connecting to a SQL Server Database using VB (VB.NET)
- URGENT: Implementing search with multiple dissimilar MySQL tables (MySQL)
- Access macros (MS Access and FileMaker Pro)
Other Threads in the PHP Forum
- Previous Thread: Regarding XML using PHP
- Next Thread: Barcode integration with PHP
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube






