PDA

View Full Version : Problem inserting into MySQL


dcahrakos
11-23-2008, 01:59 AM
Hi,

I have a variable that contains some javascript and html that I want to insert into a mysql database, but for some reason it isnt working and I cant figure out how to fix it.

basically I have a script to add a video a video section on my site and im inserting some info into the mysql database so that on the video page it can pull the necessary info, and the field thats giving me trouble is embed javascript/html

it looks like this

<script type='text/javascript' src='swfobject.js'></script>

<div id='mediaspace'>This div will be replaced</div>

<script type="text/javascript">
var so = new SWFObject('http://gamergirlsrock.ca/player.swf',
'mpl','400','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable("skin", "stijl.swf");
so.addParam('flashvars','file=videos/test.flv&plugins=rateit-1');
so.write('mediaspace');
</script>



and is stored in a variable, but when I try to insert it into mysql, it does not work, I get a syntax error with the mysql statement.

does anyone know how I would go about inserting this?

guelphdad
11-23-2008, 02:17 AM
why not just store it as a script and store the link to the script in mysql? you won't be able to run it from mysql.

dcahrakos
11-23-2008, 02:24 AM
thats a problem, there are gonna be many videos added, and that script can be changed so thats the only way I can do it..

what happens is on the video page that script is pulled from the table, and rendered on the page.