Quotes are messign up my SQL Query, need help
| From: | Shane McBride | Date: | Wed, 06 Dec 2000 14:48:27 +0000 |
| Subject: | Quotes are messign up my SQL Query, need help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28910@lists.php.net to get a copy of this message | ||
I have a customer who keeps me on my toes. Each time I think I got the php code bullet proof, she
throws me a curve ( and she doens't even know it).
She uploads what we call "Featured Items". The one in question now have a value like this:
"Hun-Gan-Tse" ("I Am Going")
It gets written to the MySQL DB just fine, and pulled from the DB for display on a web page. The
problem comes in when I/she tries to remove the item from the DB.
Here's what I have:
//Create SQL Statement
$sql = "DELETE FROM featured WHERE title = '$sel_record'";
//Execute SQL query and get results
$sql_result = mysql_query($sql, $connection) or die ("Couldn't execute query");
I suppose all the quotes and parenthesis screw this up. Any ideas?
TIA,
Shane