Forums

How to Display data from chronoform table using search

hel-G 05 Apr, 2009
Hi! I have successfully made a form that works using chronoform.. Thanks to your tutorials!🙂)

My problem is I need to be able to display the form generated data only when a the search box is used.I haven't installed any search plugin yet since I'm a total noob and I don't know where to start at this point. What do I do to be able to do this? If you have a tutorial on this do give me a link..

Thank you so much!!
GreyHead 05 Apr, 2009
Hi hel-G,

Sorry no idea how this will work - I guess it depends on the search module you use.

You could create a little ChronoForms form with some custom PHP+MySQL to search your saved data.

Bob
dianaj59 23 Apr, 2009
I've been searching for the answer to creating a php code that will do this, but with no luck.
I've created a search box on a chronoform.
I want to retrieve information from my database when criteria is entered into my search box.
So far, I get nothing.

Please let me know if you see what is wrong in this code.
HTML FORM:
<head><title>Teacher LookUp Page</head> 

<method="POST" action="<? echo PHP_SELF; ?>">
<p> </p>
<table border="0" width="100%" id="table1">
<tr>
<td align="center"> </td>
<td width="119" align="center">
<address align="right">
<span style="font-style: normal">
<input type="text" name="keyword" size="33" class="text"></span></address>
<address align="right">
<span style="font-style: normal">
<font face="Verdana" size="2" color="#FFFFFF">
<input type=submit value="Search By Last Name" style="color: #6A0204; font-family: verdana; font-weight: normal; font-size:10px; background-color: #FFFFFF; float:center" name="search"></font></span></address>
</td>
<td width="30"> </td>
</tr>
</table>


ONSUBMIT CODE
if (isset($_POST['search'])){
$keyword=$_POST['keyword'];
$sql="SELECT * FROM jos_chronoforms_teacher_registration WHERE `lastname` LIKE '%$keyword%' ORDER BY id DESC";
$result = mysql_query($sql);

$query = mysql_fetch_array($result);

echo $query['id'].' ';

echo $query['lastname'];

}

?>
Max_admin 24 Apr, 2009
Hi Diana,

please remove this from your first code :

<head><title>Teacher LookUp Page</head>

<method="POST" action="<? echo PHP_SELF; ?>">


Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dianaj59 24 Apr, 2009
Okay. I have done that. Thank you.
I would like to close this issue, because it is being handled in another thread with the subject line:
"How to create a search button on a form."
Max_admin 24 Apr, 2009
Hi Diana,

Thanks for confirming, I think that Bob's code at the other topic may be a better solution since it uses Joomla's code!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.