Current location: Hot Scripts Forums » Programming Languages » PHP » Search script improvement


Search script improvement

Reply
  #11 (permalink)  
Old 08-21-06, 09:42 AM
duesi's Avatar
duesi duesi is offline
Wannabe Coder
 
Join Date: Jun 2006
Posts: 225
Thanks: 0
Thanked 0 Times in 0 Posts
Hm,
aren't you guys kind of mimicking a DB anyway?
Why aren't you using some kind of light-weight DB like SqLite or something?
__________________
Duesi

"One of the great skills in using any language is knowing what not to use, what not to say" (Ron Jeffries)

http://www.swissbytes.de
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #12 (permalink)  
Old 08-24-06, 12:48 AM
9999 9999 is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks alot nico. Sorry, I've been away the last couple of days. The search appears to be working PERFECTLY as all values are returned. The only problem is the month, day, and year don't match the record being pulled (which means the sorting is off). In fact, most of them say December 31, 1969.

One thing that I didn't make clear was the fact that the dates in the database are in the form August 24, 2006 which is the F j Y form I believe. Could this cause the problem?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #13 (permalink)  
Old 08-24-06, 03:59 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
Could you maybe post some lines of the file? How exactly is the date stored?

Like this:
August|24|2006|Tip of the day...

???

I tested it with the example in your other thread and it worked for me.

EDIT:

But as Duesi said, I'd recommend using a database instead.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #14 (permalink)  
Old 08-25-06, 02:18 AM
9999 9999 is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Looks like you've got it. Unfortunately, I don't have the file on this machine but I am using "dummy" data like this:
Code:
July|19|2006|Sample text "Sample text Sample text" Sample text Sample text 07-19-2006
May|7|1706|Sample text Sample text Sample text Sample text Sample text 05-07-1706
February|29|1961|Sample text Sample text 'Sample text' Sample text Sample text 02-29-1961
October|26|1995|Sample text "Sample text Sample text" Sample text Sample text 10-26-1995
April|5|1836|Sample text Sample text Sample text Sample text Sample text 04-05-1836
July|11|1954|Sample text Sample text 'Sample text' Sample text Sample text 07-11-1954
October|1|2000|Sample text Sample text Sample text Sample text Sample text 10-01-2000
Each field is seperated by a "|" with a hard return after each line/record. In my test file I have over a thousand records. At the end of each line I put the date like this"07-11-1954" so I could compare it to the the month, day, and year fields associated with it "July|11|1954|"

I also used a variety of years because in the future, the database might contain historical references.

LOL a database would probably have been much easier, but at the time I started, I just went with what I had some knowledge of.



Quote:
Originally Posted by nico_swd
Could you maybe post some lines of the file? How exactly is the date stored?

Like this:
August|24|2006|Tip of the day...

???

I tested it with the example in your other thread and it worked for me.

EDIT:

But as Duesi said, I'd recommend using a database instead.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #15 (permalink)  
Old 08-29-06, 12:46 AM
9999 9999 is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Nico, you were right, it does work and I found out what causing the errors. Some of the records I used contained values before the epoch (January/1/1970) and that is causing the script to return December 31, 1969 for all of those records.

So my question is, is there any way to get around this so that values pre 1970 would work?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 11:17 AM
Hep with Simple Search script pentatonic145 General HotScripts Site Discussion 0 06-30-04 03:31 PM
mysql/php search script dawggy505 PHP 1 06-22-04 07:49 AM
Simple search script niceguyonline Script Requests 3 03-08-04 12:09 AM


All times are GMT -5. The time now is 01:12 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.