Skip to main content
Known Participant
May 13, 2008
Question

Search options not working in SQL

  • May 13, 2008
  • 3 replies
  • 477 views
Hi,

I have the Following SQL statement that filters for a Search Criteria and it works fine in MySQL 4

SELECT *,MATCH (presentationID,presentationTitle, PresentationName,ProductlineName, LevelName,RoleName,presentationDescrip) AGAINST (SearchString IN BOOLEAN MODE)
FROM tbpresentations
WHERE MATCH (presentationID,presentationTitle, PresentationName,ProductlineName,LevelName,RoleName,presentationDescrip) AGAINST (SearchString IN BOOLEAN MODE)
ORDER BY productfamilyName DESC

The SearchString Variable has the following parameters:

Name = SearchString
Type = Text
Default Value = -1
Run-time Value = $SearchStringSQL

updating to SQL 5 returns the error:
MM_ERROR: MySQL Error#: 1054 Unknown column 'SearchString' in 'field list'

Any ideas?

cheers

This topic has been closed for replies.

3 replies

Known Participant
May 14, 2008
That did not work. I deleted the MM Files and the error still returned.

Again, Functionality is unaffected which is completely unusual for a coding environment.

I have no access to the recordset bindings, so I handcoded the references instead, and it works fine.

I took the issue to our worldwide Web Developement Department, as they are responsible for the Organisations Corporate and ECommerce Sites and they had a look. (I look after the Training Intranet)

They use Visual Studio for the sites and I gave them all the code.

They ran a debugger and found nothing wrong with the code, Which is why it runs fine.

After a few hours of testing and retesting and checking all the lines of code (They get paid the big bucks) they concluded that the error is caused by a bug in Dreamweaver CS3 unable to parse or recognise changes to either MySQL Syntax or PHP 5.

Dreamweaver has added the $SearchString variable as a Table Column in the Bindings for some daft reason based on the SQL Statement, which is causing the error. It also added another Column called 'Real', I have no idea where that was coming from. It also added a third Table field tothe Recordset bindings called MATCH.

My Local testing Servers (3 of) all use WAMPserver 2 and generate the same eror.

The live Intranet Server, which is a new Win2003 Dell Server, uses IIS6 and also generates the same error when I "test" it through CS3.

So, I dusted off a copy of Dreamweaver 8 installed it, and guess what....no errors.

They said the immortal words that programmers never say: " Ignore the error, it wont affect functionality".

Just thought I'd let you know.

cheers for the help.
Inspiring
May 13, 2008
There was a problem someone had a few years ago on here. They were told to keep the files as they are and delete the two files in _mmServerScripts folder.

Try that I had a similar problem I deleted they file and just rebooted and no probs.

I was using MySQL 3.5 sumthing. I'm using 4.1 now its very stable.

I'm scared to upgrade to PHP 5.2 I'm using 5.0.3.3
I'm using Sokkit as my webserver provider using Apache 2
Sorry a little off topic been a long day.

Let me know how you get on.
Inspiring
May 13, 2008
Hi mate,
Try putting ' at each column
e.g:
WHERE MATCH ('presentationID','presentationTitle', 'PresentationName','ProductlineName','LevelName','RoleName','presentationDescrip')

Its either double or single quotes.
Known Participant
May 13, 2008
Hi there,

Thanks for the reply, but no luck I'm afraid. I tried a variety of different "" or ' ' permutations but a variety of errors appeared.

The Search actually works fine, strangely enough, but I cannot acess the Recordset dropdown. When I click the + sign, it has the MM_ERROR: MySQL Error#: 1054 Unknown column 'SearchString' in 'field list' error.

Another strange occurance is that many changes to the SQL Code does not stick. I have to go back in a sometimes half the code is missing.

I also think it has something to do with the first MATCH request.

When I do get access to the Binding data by removing part ofthe SQL code, a field reference of

MATCH (presentationID,presentationTitle, PresentationName,ProductlineName, LevelName,RoleName,presentationDescrip) AGAINST (SearchString IN BOOLEAN MODE)

shows in the drop down menu.

Very Strange.

Oh I need to add that I added a homemade condition to the $SearchStringSQL variable.

At the top of the Results page I added:

<?php $SearchString=$_GET['SearchString'];?>
<?php $SearchStringSQL = "+".str_replace(" " , " +", $_GET['SearchString']); ?>

This allows several words to be typed into the Search Box, and only records containing ALL of those words will be displayed. This allows the users to filter deeper as one or two words could still produce dozens of records.

Again, it works fine on the Server running mySQL 4, which is now the backup of the Server running mySQL5 so I don't think this has a bearing on the issue.

I'm stumped...............