SMFHacks.com

SMF Classifieds => Support => Topic started by: vkot on April 16, 2008, 02:09:03 am

Title: Database error when searching
Post by: vkot on April 16, 2008, 02:09:03 am
I get this error when I make a search:
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'i.ID_CAT = 5 AND AND (i.title LIKE '%Asama%' OR i.description LIKE '%Asama%')
' at line 10
File: /xxxxxx/xxxxxx/Sources/Load.php(1726) : eval()'d code
Line: 4113
(file path is hidden)

I guess there was a problem at line 1726 (4113 does not exist), which is the line with the "eval()" here:
Code: [Select]
// Are we going to use eval?
if (empty($modSettings['disableTemplateEval']))
{
$file_found = file_exists($filename) && eval('?' . '>' . rtrim(file_get_contents($filename))) !== false;
$settings['current_include_filename'] = $filename;
}
Title: Re: Database error when searching
Post by: SMFHacks on April 16, 2008, 08:57:34 pm
What were searching for and what options did you select when you did a search?
Title: Re: Database error when searching
Post by: vkot on April 19, 2008, 02:45:55 am
Now it works! Without me changing anything...
Title: Re: Database error when searching
Post by: vkot on July 20, 2008, 10:54:05 am
Well... I installed SMF Classifieds on another forum and it shows a similar error:

Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (i.title LIKE '%asama%' OR i.description LIKE '%asama%')
ORDER BY i.ID_LI' at line 10
File: /xxxxxx/xxxxxx/Sources/Load.php(1733) : eval()'d code
Line: 5052
The SQL query string displayed is incomplete, and it changes if you change the search string! Only the 2nd line changes, it mays show ORDER BY i.ID_' at line 10 or ORDER BY i.ID_LISTING' at line 10, etc. This is weird...

And below that, SMF says:
Quote
<b>Note:</b> It appears that your database <em>may</em> require an upgrade. Your forum\'s files are currently at version ' . $forum_version . ', while your database is at version ' . $modSettings['smfVersion'] . '. The above error might possibly go away if you execute the latest version of upgrade.php

I don't know what I'm supposed to do and if there is any risk of destroying my database...
Title: Re: Database error when searching
Post by: SMFHacks on July 20, 2008, 02:19:38 pm
Does it occur with the latest version of the classifieds?

If so what exactly are you searching for and what options did you select.
Title: Re: Database error when searching
Post by: vkot on July 21, 2008, 06:24:26 am
I have smf classifieds 1.2.2 and SMF 1.1.5
(In the classifieds admin page it says that I have 1.2.2 and that the latest version is 1.2.1. It seems that you missed something ;D)

That error is shown only to the admins.
To the users is shown a short message from SMF:
Quote
Database Error
Please try again.  If you come back to this error screen, report the error to an administrator.

It happens in every classifieds search, whatever the options.
Title: Re: Database error when searching
Post by: SMFHacks on July 21, 2008, 10:55:51 pm
1.2.3
!Fixed a couple of bugs with searching for listings.
Title: Re: Database error when searching
Post by: vkot on July 24, 2008, 03:39:35 am
Problem solved, with this fix. Thanks :)
Title: Re: Database error when searching
Post by: vkot on September 11, 2008, 03:40:31 am
I have noticed the same problem when searching, in the following conditions:

- When I choose a category to search in
- When I search ads from a certain member

The error is:
Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (i.title LIKE '%guitar%' OR i.description LIKE '%guitar%')
ORDER BY i.ID' at line 10
Αρχείο: /xxx/xxx/xxx/public_html/forum/Sources/Load.php(1737) : eval()'d code
Line: 5201
(I have upgraded to SMF 1.1.6)
Title: Re: Database error when searching
Post by: SMFHacks on September 26, 2008, 09:34:57 pm
I have noticed the same problem when searching, in the following conditions:

- When I choose a category to search in
- When I search ads from a certain member

The error is:
Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (i.title LIKE '%guitar%' OR i.description LIKE '%guitar%')
ORDER BY i.ID' at line 10
Αρχείο: /xxx/xxx/xxx/public_html/forum/Sources/Load.php(1737) : eval()'d code
Line: 5201
(I have upgraded to SMF 1.1.6)
Fixed for Classifieds 1.2.10