I am simply trying to insert these objects into a table with php.
$sql = 'INSERT INTO table VALUES( '.$active.' , '.$id.' , '.$time.' , '.$url.' ,"some string" )';
The url in the above code is: http://www.youtube.com/watch?v=sAYc3gGjYW8
When I leave the url column empty it works, when I put an url in it then it doesnt work and I get the following error.
"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 '://www.youtube.com/watch?v=sAYc3gGjYW8 ,"some string" )' at line 1."
QUESTION:
Why does the url not insert just like a normal string?
Is there some sort of function I need to perform on the url_string before it is accepted by MySQL?
PS - the url column is currently VARCHAR(256).
Any help appreciated guys...