Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-06-2004, 12:47 PM
paranoidz's Avatar
Novice Webmaster
 
Join Date: Jul 2002
Location: dalam perut bumi
Posts: 40
Rep Power: 0
paranoidz is on a distinguished road
fast search

i have create a code...but can anybody help me to make it fast search...let say i have a thousand data inside my sql server...after click search all the data will come out in a few second...

PHP Code:
<table width="550"  border="0" cellpadding="0" cellspacing="0" class="border">      
<tr>        <td><?php include ('/head.php'); ?></td>      </tr>
<tr>        <td>
<form action="search.php" method="post" class="text">
          Search Domain           
<input name="query" type="text" class="text">  
<input type="submit" name="submit" value="Search">  
</form>  <table border="0" cellpadding="3">  
<?php  
$db 
mysql_connect("localhost","root");
mysql_select_db("data",$db);  
$sql mysql_query("SELECT domain, company, person FROM c_data 
WHERE domain LIKE '$query' OR company LIKE '$query'"

or die (
mysql_error());    
while(list(
$domain$company$person)=mysql_fetch_array($sql))
{    
echo
"        <tr>";  
echo
"          <td class=\"text\" witdh=\"40\" align=\"left\">$domain</td>";  
echo
"         <td class=\"text\" witdh=\"30\" align=\"left\">$company</td>";    
echo
"          <td class=\"text\" witdh=\"30\" align=\"left\">$person</td>";  
echo
"        </tr>";      }  ?>    </table></td>      </tr>      
<tr>        <td><?php include ('/foot.php'); ?></td>      </tr>    </table>
help me...
__________________
<embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®

Last edited by paranoidz; 10-06-2004 at 12:50 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-06-2004, 02:51 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 116
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
what is your script's current speed? perhaps you need to optimise the database to increase the speed. Try to make index.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-06-2004, 03:51 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 95
sufyan is on a distinguished road
Hey,

Since your trying to search multiple fields, I would recomment creating a FULLTEXT index and using MySQL's fulltext searching function...

A good article on it, written by Jim Ferrara: http://www.zend.com/zend/tut/tutorial-ferrara1.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-06-2004, 03:53 PM
lina's Avatar
Novice Webmaster
 
Join Date: Mar 2004
Location: malaysia
Posts: 96
Rep Power: 57
lina is on a distinguished road
Send a message via Yahoo to lina
yeah, use indexing
__________________
liNa
http://2lina.blogspot.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-06-2004, 06:46 PM
paranoidz's Avatar
Novice Webmaster
 
Join Date: Jul 2002
Location: dalam perut bumi
Posts: 40
Rep Power: 0
paranoidz is on a distinguished road
thanks guys...i try out the tutorial first...n let u all know the progress

err lcf...how to check the speed of my searching...
__________________
<embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-06-2004, 01:00 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 116
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
here is sample code to determine PHP execution time:
http://www.developerfusion.com/show/2058/
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 15-06-2004, 04:20 PM
paranoidz's Avatar
Novice Webmaster
 
Join Date: Jul 2002
Location: dalam perut bumi
Posts: 40
Rep Power: 0
paranoidz is on a distinguished road
after searching and all data are viewed..i want to update the data...could any body give me idea how to update it or delete it
__________________
<embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 15-06-2004, 04:30 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 116
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
huh?

use DELETE or UPDATE?
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 17-06-2004, 04:29 PM
lina's Avatar
Novice Webmaster
 
Join Date: Mar 2004
Location: malaysia
Posts: 96
Rep Power: 57
lina is on a distinguished road
Send a message via Yahoo to lina
yeah use DELETE and UPDATE sql statement...
__________________
liNa
http://2lina.blogspot.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 18-06-2004, 09:31 AM
paranoidz's Avatar
Novice Webmaster
 
Join Date: Jul 2002
Location: dalam perut bumi
Posts: 40
Rep Power: 0
paranoidz is on a distinguished road
yup i know...but after i click delete button it will transfer to other coding that content delete quering sql code...but how i gonna inform to the quering to delete the correct data...let say i'm using checkbox...any example...i had no idea what to do rite now...
__________________
<embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 18-06-2004, 10:16 AM
hafizuddin's Avatar
Novice Webmaster
 
Join Date: May 2002
Location: Klate
Posts: 91
Rep Power: 80
hafizuddin is on a distinguished road
err, make a column name 'id' or wateva u want as primary key with auto increment. so all records will have unique id for them.

PHP Code:
mysql_query("DELETE FROM c_data WHERE id=something;"); 
__________________
PHP Code:
<?php echo "PHP is a language?"?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 19-06-2004, 12:38 PM
paranoidz's Avatar
Novice Webmaster
 
Join Date: Jul 2002
Location: dalam perut bumi
Posts: 40
Rep Power: 0
paranoidz is on a distinguished road
tq tq...bit blur yesterday
__________________
<embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 25-06-2004, 09:27 AM
paranoidz's Avatar
Novice Webmaster
 
Join Date: Jul 2002
Location: dalam perut bumi
Posts: 40
Rep Power: 0
paranoidz is on a distinguished road
i have one question...macam mana nak guna dropdown list mase search...contoh macam

http://www.yellowpages.com.my/search.asp
__________________
<embed src="http://www.geocities.com/paranoidz02/new.swf" WIDTH=400 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>®
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 27-06-2004, 11:54 PM
hymns's Avatar
Senior Webmaster
 
Join Date: Nov 2001
Location: Johor
Posts: 768
Rep Power: 100
hymns is on a distinguished road
Send a message via ICQ to hymns Send a message via Yahoo to hymns
use sql query with dropdown value for keywordz
__________________
I hate when:

vBulletin Message:
Sorry! The administrator has specified that users can only post one message every 60 seconds
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast search engine with web, image, video searches ketyung Websites Review and Suggestion 1 27-03-2006 06:22 PM
How to load fast marco Websites Review and Suggestion 16 17-05-2005 05:22 PM
Get help fast at www.Outsource.net.my lowyat99 Website Programming 0 03-10-2004 01:13 AM
Get help fast at www.Outsource.net.my lowyat99 Website Programming 0 03-10-2004 01:12 AM
Get help fast at www.Outsource.net.my lowyat99 Website Design 0 03-10-2004 01:09 AM



All times are GMT +8. The time now is 08:07 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16