Passing Search form to database query
-
Hi! I feel I’m close on this, but I am totally missing something.
I have on one page a form where I simply want someone to enter a surname, if they want to, as the table grows. Then below the form are the results of the query. I do want all rows to populate by default.
I have tried the php gets and I’m about to beat my head against the wall. Thinking that within the SQL query report that the where statement needs to include a link to the page….But I get “no results” and if the form has nothing entered, I want it to show all values.
Okay, Here is the code I have on Surname-Search page:
<form action=”” method=”post”>Search Surname: <input name=”searchsurname” type=”search” /> <input type=”submit” value=”Submit” /></form></br>
[SQLREPORT name=”test-surname-list”]Now here is the query in the SQLReport as it is now that works:
SELECT CONCAT(‘‘,’‘,’‘) as ‘Email’, surname as ‘Surname’, county as ‘County’, state, country as ‘Country’, yearbegin as ‘Begin Year’, yearend as ‘End Year’ from database.wp_surnames ORDER By surnameThe following is just one of the Select statements I’ve tried:
[$query = $_GET[“https://website/surname-search2/searchsurname”];
echo ELISQLREPORTS_view_report(“”, “SELECT CONCAT(‘‘,’‘,’‘) as ‘Email’, surname as ‘Surname’, county as ‘County’, state as ‘State/Prov/Reg’, country as ‘Country’, yearbegin as ‘Begin Year’, yearend as ‘End Year’ from database.wp_surnames WHERE (surname ='<?php $query?>’)”);]
- The topic ‘Passing Search form to database query’ is closed to new replies.