Jump to content

Using Links and MySQL


Drezard

Recommended Posts

I'm writing a bit of code that uses this query:

 

"SELECT * FROM articles WHERE link='".$link."'"

 

When I execute this in the mysql console such as :

 

SELECT * FROM articles WHERE link='http://www.theage.com.au/travel/travel-news/nerd-bird-flies-like-a-brick-20100326-r0eh.html;

 

It works perfectly. Displays the results I want...

 

But when I try and do the same query with PHP I get :

 

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.theage.com.au/travel/travel-news/nerd-bird-flies-like-a-brick-201003' at line 1

 

Ideas anyone? I'm guessing its formatting?

 

Daniel

Link to comment
https://forums.phpfreaks.com/topic/196558-using-links-and-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.