Search Database and List Results
5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 26, 2012 (RSS)
By Mohaukla - April 24, 2012
So it would search all the titles, summary, keyword, and content areas and list out the entries that match the search.
<form class="search" id="search" method="post" action="search.php">
<input type="text" onFocus="if(this.value=='Looking for something...') this.value='';" onBlur="if(this.value=='') this.value='Looking for something...';" value="Looking for something..." size="30" class="inputbox" maxlength="60" name="title,summary,keywords,content,content_keyword" id="search_box">
</form>
Then on the results listing page
<div class="layout-cell content">
<div class="box post">
<?php foreach ($THESEARCHRESULTS as $record): ?>
<div class="componentheading"><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></div>
<div class="box-body post-body">
<div class="post-inner article">
<article class="postcontent">
<!-- article-content -->
<?php if ($record['summary']): ?>
<?php echo $record['summary'] ?><br/>
<?php endif ?>
<?php ($record['content']): ?><!-- Would like to limit this output to a certain number of characters -->
<?php endforeach ?>
<div class="cleared"></div>
<!-- /article-content -->
</article>
<div class="cleared"></div>
</div>
<div class="cleared"></div>
</div>
</div>
<div class="cleared"></div>
</div>
Its ugly and does not work in its state now but that is what I'm shooting for.
Any help will be appreciated.
Michael
Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.
"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"
Re: [justritedesign] Search Database and List Results
By Jason - April 25, 2012
When you say that it isn't working, are you getting an error message, or is it that no results are being returned? Can you attach search.php so we can take a closer look at what's happening?
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Search Database and List Results
By Mohaukla - April 25, 2012 - edited: April 25, 2012
Ok I went with the basic multisearch.php and after setting it up with my table info I seem to get an error message.
Search Multiple Tables: MySQL Error: Unknown column 'summary' in 'field list'
I have attached my file for you to look at.
To see it in action goto http://montedentistry.com/www2/multisearch.php
Use a dental keyword like teeth,dentures, or whitening.
Any idea what is wrong?
Thanks
Michael
Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.
"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"
Re: [justritedesign] Search Database and List Results
By Jason - April 26, 2012
It seems like 1 of your two sections doesn't have a field called summary in it. Make sure that the fields you use in the form match fields in your target section(s).
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Search Database and List Results
By Mohaukla - April 26, 2012
I did have one field wrong.
The site is working now with the search boxes all filtering properly.
http://montedentistry.com/www2/search.php
If you use teeth as the keyword you will see what I have done with the multisearch.php page parts.
I was also able to figure the cloud tags and make them use the search page as well.
Thanks for your help ...
Michael
Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.
"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"