Page 1 of 1

SQL error on spell forms.

Posted: Tue Oct 20, 2009 9:39 am
by relentless
Hey Petu,

When I type anything in the form with a ' in it, it'll generate this error. Guess you need to addslash() to all the form fields in the backend.

spells.php
MYSQL_QUERY
SELECT spells.* FROM spells WHERE 1=1 AND name like '%prophet's%gift%' ORDER BY name
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 's%gift%' ORDER BY name' at line 3
Have you sourced the eqbrowser tables in your database ?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/web8/31/73/51034773/htdocs/forest/webtools/spellss.php on line 51
# No spells found matching those criterias.
Just a heads up.

Relentless

Re: SQL error on spell forms.

Posted: Tue Oct 20, 2009 9:41 am
by relentless

Code: Select all

'%prophet's%gift%'


Also need to decode the HTML entities on the form field as well, in addition to the addslashes...not sure if you already store spaces as % in your tables.

Re: SQL error on spell forms.

Posted: Tue Oct 20, 2009 6:20 pm
by Topsy
Well until the fix gets implimented, you'll just have to put a \ before your '.

hope that helps :)

Re: SQL error on spell forms.

Posted: Mon Oct 26, 2009 5:07 pm
by Topsy
*fixed*

Re: SQL error on spell forms.

Posted: Wed Dec 09, 2009 4:47 pm
by Koeril
New error when searching any spell

spells.php
MYSQL_QUERY
AND name like '%Hallowed%' ORDER BY name
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 name like '%Hallowed%' ORDER BY name' at line 1

Re: SQL error on spell forms.

Posted: Wed Dec 09, 2009 7:10 pm
by Topsy
fixed