atchy Posted December 13, 2006 Share Posted December 13, 2006 Hi,I am currently moving my site over from ASP to PHP and I am trying to create a FULL TEXT search facility. I have created a results page which works perfectly if I type in the name/s directly but unable to get a text field on my search page to work. I am using Dreamweaver, MySql + PHP and testing locally using Apache. A lot of the PHP code is quiet baffling to me and have been using the MySQL Full-Text Searching with PHP from your site as a guide. I feel it must be straightfoward but beyond me. The code from the Recordset is below.I would appreciate any guidance advice so that I may maintain some sanity.ThanksJohnSELECT artistinfotbl.artistName, artistinfotbl.lastName,artistinfotbl.headDescription, MATCH (artistinfotbl.artistName, artistinfotbl.lastName) AGAINST ('$search' IN BOOLEAN MODE) AS scoreFROM artistinfotblWHERE MATCH (artistinfotbl.artistName, artistinfotbl.lastName) AGAINST ('$search' IN BOOLEAN MODE)ORDER BY score DESCreplacing '$search' with name/s gives exactly what I want. Quote Link to comment Share on other sites More sharing options...
fenway Posted December 16, 2006 Share Posted December 16, 2006 So the interpolation isn't working? Quote Link to comment Share on other sites More sharing options...
atchy Posted December 16, 2006 Author Share Posted December 16, 2006 Hi Fenway,Not sure what you mean by Interpolation. In my ASP version I added a variable to the recordset (Request.QueryString) but trying to add a variable with #search# as shown in 'Dreamweaver help' gives a blank page. It seems that I am missing some code but as I am totally new to PHP I am not sure what this is or where it should be.If you can advise or point me to a straightfoward tutorial or beginners guide to PHP I would be most gratefulThanks for your replyRegardsJohn Quote Link to comment Share on other sites More sharing options...
fenway Posted December 16, 2006 Share Posted December 16, 2006 What I mean is that I want to see what the query resolves to after the variable has been substituted.... Quote Link to comment Share on other sites More sharing options...
atchy Posted December 16, 2006 Author Share Posted December 16, 2006 Substituting '$search' with e.g. 'Gregor anda smith vanessa' (a mixture from 2 columns from table) displays on my results page a list of people matching the keywords; exactly what I want. To my simplistic way of thinking the search page/form is not talking to the results page. When I try putting in a variable the blank page that results is exactly that, there is no code at all in view source.Sorry I am probably not explaining it in the correct way.John Quote Link to comment Share on other sites More sharing options...
fenway Posted December 18, 2006 Share Posted December 18, 2006 How are you settting $search? Quote Link to comment Share on other sites More sharing options...
atchy Posted December 18, 2006 Author Share Posted December 18, 2006 My text box name is 'search' and I thought that '$search' was/is the variable I need.Further research has me thinking that I need something like:$something = (isset ($_GET['search']);and$something = mysql_escape_string($_GET['search']);ThanksJohnYoure last comment got me thinking (its hard at my age) and blundering around and adding $searchstring = mysql_escape_string($_GET['search']);seems to have got me going.Many thanks for your patience with a PHP beginner. All I have to do now is get the results to link to the details page.I may be back.regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.