[K12OSN] Help with php / mysql

Brian Chivers brian at portsmouth-college.ac.uk
Wed Feb 4 12:02:34 UTC 2009


I'm trying to insert the text below into a mysql table but it's complaining, I think it's the ' 
that's causing the problem.

childrens's/youth program (general)

The table is called stream and the field I'm trying to insert into is called genre and it's a 
varchar(200) collation utf_general_ci

This is the command I'm using

mysql_query(INSERT INTO stream (channel, starttime, title, description, genre, filename) VALUES 
('$channel','$starttime','$title','$description','$genre','$filename'));

All the other fields work OK & if I remove the ' from $genre it works OK.

Did think about doing a search & replace before I insert but I'd have to do it on the other fields 
as well so I'd like to be able to solve it another way :-)

Thanks
Brian

------------------------------------------------------------------------------------------------
    The views expressed here are my own and not necessarily
 
                the views of Portsmouth College    




More information about the K12OSN mailing list