|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Industry Role:
Join Date: May 2002
Location: Toronto
Posts: 8,475
|
MySQL easy syntax question
update category_text set text='this is a problem because it's got an apostrophe in it', keywords='asdf,asdf' where id='1';
Just that the string I want to insert has an apostrophe.. Is that going to mess the syntax up? |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Oct 2005
Location: St. Louis, MO
Posts: 671
|
try this
update category_text set text='this is a problem because it\'s got an apostrophe in it', keywords='asdf,asdf' where id='1';
__________________
Design | SEO | Photo / Video Editing ( ICQ 49354667 ) |
|
|
|
|
|
#3 |
|
Confirmed User
Industry Role:
Join Date: May 2002
Location: Toronto
Posts: 8,475
|
Nice thanks!! Now I know why I've seen those things printed around my site sometimes heh
|
|
|
|
|
|
#4 |
|
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,428
|
google for php html entities
|
|
|
|
|
|
#5 |
|
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
if this is for a php script then you can just use http://us3.php.net/mysql_real_escape_string
Code:
$sql = "update category_text set text='".mysql_real_escape_string("this is a problem because it's got an apostrophe in it")."', keywords='asdf,asdf' where id='1';"
$affected_rows = mysql_query($sql);
|
|
|
|