Help... Error having to do with "quotes" I think..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
John Rowe
Forum Newbie
Posts: 14
Joined: Thu Nov 20, 2003 7:53 pm

Help... Error having to do with "quotes" I think..

Post by John Rowe »

Hi,

I'm getting this error...
WordPress database error: [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 '/font>A minimally invasive procedure using sound waves to destroy the tissue of' at line 4]

and this is the line in the script tha it is refering to...

Code: Select all

$line = "<font color='$line2_color'>".$line."</font>";
I'm also getting a similar error for this line...

Code: Select all

$line = "<a href='$link' target='_blank'>Full $someotherwords article...</a>";
Here is the error for that one...
WordPress database error: [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 'http://www.medicalnewstoday.com/medical ... wsid=34938' target='_blank'>Fu' at line 3]

I feel pretty sure it has to do with the "quotation marks"... but I have no idea what changes to make.

Any help is highly appreciated.

Kindly,
John
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

I don't know what WordPress is but ... You need to escape quotes that go into the db. In PHP you would addslashes(). Other wise you need \' like that. Hope that helps
Post Reply