Jump to content

[SOLVED] mysql and single quotes


Derleek

Recommended Posts

I am storing e-mails for a mass e-mail system i'm throwing together.

 

I can't figure out how to allow people to put a single quote in the message without throwing everything off...

 

this is the code that i have now, which doesn't allow users to use the ':

$sql = "INSERT INTO mail (msg) VALUES ('$content')";

 

I've tried:

$sql = `INSERT INTO mail (msg) VALUES ("$content")`;

and get 'query was empty'

 

and:

$sql = 'INSERT INTO mail (msg) VALUES ("$content")';

the sql inserts $content

 

how do i get around this?

Link to comment
https://forums.phpfreaks.com/topic/116303-solved-mysql-and-single-quotes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.