It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

Creating search results in a table format

Moderator: Malcolm

Creating search results in a table format

Postby Deicer on Mon Sep 27, 2010 8:16 pm

Hi,
I'm looking to build a search engine, I have a prototype ready, http://www.bkslap.com, but i want to make my own search engine and create a search results page that is in a table format, with results in squares. Does anyone know how this could be done with PHP MySQL and HTML?
thanks,
Any help would be much apperciated!
deicer
Deicer
 
Posts: 1
Joined: Fri Sep 24, 2010 6:01 pm

Re: Creating search results in a table format

Postby HotNoob on Mon Sep 27, 2010 8:28 pm

it would be something a long the lines of:
Code: Select all
<table>
<?php
$query = 'SEARCH QUERY HERE';
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
echo '<tr><td>'.$row['RESULTS'].'</td></tr>';
}
?>
</table>



something like that; it all depends on your setup and how you want the results outputted tho.

OH and i see you wrote down you needed the mysql stuff for it?
well a basics would just be sometihng along the lines of:
SELECT * FROM `content` WHERE `keywords(orwhatever u want to use)` LIKE '%STRING TO LOOK FOR%'
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am

Re: Creating search results in a table format

Postby HotNoob on Mon Sep 27, 2010 8:32 pm

oh yeah, and the '%' character is the wild card character

for example,
if you were to do
'%ike'
you could get 'like' as a result.
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am


Who is online

Users browsing this forum: No registered users and 0 guests