i have a variable with the following text
Code: Select all
<?php
$school = "Noah's Ark Pre-School";
?>my insert query is as follows
Code: Select all
<?php
insert into my_table (schoolf) values ('$school')
?>Moderator: General Moderators
Code: Select all
<?php
$school = "Noah's Ark Pre-School";
?>Code: Select all
<?php
insert into my_table (schoolf) values ('$school')
?>Code: Select all
<?php
$school = addslashes( "Noah's Ark Pre-School" );
// or
$school = mysql_escape_string( "Noah's Ark Pre-School" );
?>If your seeing slashes you may want to read up on Magic Quotes.gurjit wrote:how can i get rid of the slashes by using the mysql_escape_string function. this stores \ in the database.