I have a search form with two objects for search-
- dropbox to select how to search:
-by name
-by department
-by title
- text to type text for search
dropbox is POSTvariable1
textbox is POSTvariable2
How do I put the information from a mysql table into an array, and then:
A. Search collumn headings and data based on the two POST variables?
(select from array where collumn=POSTvariable1 AND data=_POSTvariable2)
B. Show resuls in html table
C. With paging?
There is no way of knowing what collumn heading to search for until _POSTvariable1 is read.
The array would be availble for requerying for new searches, paging.
HERE IS WHAT I HAVE SO FAR:
if(isset($go)) {
$stxt=?POST['txtbox'];
$ssel=?POST['dropbox'];
mysql_connect('connection stuff'); mysql_select_db('x') or die(mysql_select_db_error());
// I need to get all collumn headings for search based upon selection from combobox, and because data will be searched later I need that also
$result = mysql_query('SELECT * FROM table') or die(mysql_error());
//put into an array
$strarr = mysql_fetch_array($result); {
// next, i need to be able to search collumns as well as data and return them in a table.
HERE IS THE GENERAL IDEA:
http://www.phpbuilder.com/board/showthread.php?threadid=10273828&highlight=select+from+array
How would I do this?
Thanks In Advance