having trouble inserting something into SQL database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

having trouble inserting something into SQL database

Post by psychotomus »

im trying to insert <script>waspEmbed('example1.flv', 500, 367);</script>


i guess its using the , to seperate fields or something. how do i insert this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Can you clarify with any errors?
phpice
Forum Newbie
Posts: 4
Joined: Sun Feb 04, 2007 1:57 pm

Post by phpice »

If you are trying to insert that exact text, then you could have problems depending on how you quote your values. If you quote the text with single quotes, you will need to escape your single quotes in your text. For example, if your field is named myfield, then in MySQL you would do:

Code: Select all

...SET myfield='<script>waspEmbed(\'example1.flv\', 500, 367);</script>'
The comma should not be a problem as long as you have correctly quoted your value.

You might like to check out http://dev.mysql.com/doc/refman/5.0/en/ ... yntax.html for more info using MySQL.
Post Reply