PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 2nd, 2002, 09:27 AM
fumi fumi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Japan
Posts: 9 fumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP/MySQL Search Tutorial

Hi there,

I have been working through this article on PHP/MySQL Search at DevArticles.

http://www.devarticles.com/content....cleId=79&page=1

I have worked through the tutorial and haven't received any errors at all from either MySQL or PHP.

However, when I reached the end of the tutorial and type in 'MySQL' it only brings back one result even though it should be two.

If I enter 'MySQL Apache', it still only brings back one result, when it should be three.

I haven't altered the scripts in any way at all, as I am a real newbie.

Please can anyone help me,

Thanks

Reply With Quote
  #2  
Old July 2nd, 2002, 07:21 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 588 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Hi Fumi,
Did you create all of the required rows in the MySQL table? What I would suggest is taking the MySQL queries from the PHP script and run them against the database using the MySQL console application if you can, this way you can see if its the queries or the script that isn't working.

That tutorial was written a while back and as such was written for PHP 4.1. Which version of PHP are you using? If it's 4.2 then you may need to change some of the globally dependant variable declerations, etc.

Reply With Quote
  #3  
Old July 3rd, 2002, 03:36 AM
fumi fumi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Japan
Posts: 9 fumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Checked tables

I did check these sql tables. As I have been trying this script, I believe the PHP is at fault somehow. No matter how many keywords or articles I add, the script will only ever bring back the last one.

I.e, if I insert 'MySQl' 1,2,3 (indicating that 'MySQL' is available in three articles) then the script will only bring back article three etc.

If I run update so that it reads ( 'MySQL' 1,2 ), then keying in MySQL will only bring back article two. The constant factor is that the script only seems to want to bring back one result and that result is always the last one.

I am running PHP 4.2.1

Fumi

Reply With Quote
  #4  
Old July 3rd, 2002, 03:52 AM
fumi fumi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Japan
Posts: 9 fumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem solved

Somebody found a solution for me.

PHP:
------------------------------------------------------------------------


$articles*=*array_unique($articles);


------------------------------------------------------------------------
This was wiping the other entries that was being stored.

Thanks again,

Fumi

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP/MySQL Search Tutorial


Developer Shed Advertisers and Affiliates


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap