<>
Escape them by putting a slash in front of them. If you have a line of text
that says 'This is the problem area I don't want to screw up', put 'This is
the problem area I don\'t want to screw up'.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/uns
Before you save the paragraph into the db, use the addslashes() function
like this:
$textVar = addslashes($textVar);
That escapes all the characters like commas, return and whatever else
MySQL may have trouble with. The reverse the process before you display
it:
nl2br(stripslashes($textVar))
T
s" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Subject: Re: [PHP] updating pages with php
Date: Wed, 5 Mar 2003 13:44:40 -0500
> $Query = "UPDATE $TableName SET Intro_Title = '$Intro_Title', Intro =
> '$Intro' WHERE ID = '$ID&
> $Query = "UPDATE $TableName SET Intro_Title = '$Intro_Title', Intro =
> '$Intro' WHERE ID = '$ID'";
But what's being sent to SQL? What's contained in $TableName, $Intro_Title,
etc.? And what data types are all those fields?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vis
$Query = "UPDATE $TableName SET Intro_Title = '$Intro_Title', Intro =
'$Intro' WHERE ID = '$ID'";
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Subject: Re: [PHP] updating pages with php
Dat
> What I have discovered is that I can manually type it in the mysql server
> with whatever characters I want, but when I try to update it with a sql
file
> or via the webpage I created with the comma's it gives me errors. I take
> them out of the sql text and webpage and it works fine.
The proble
<>
Don't forget to escape apostrophes and double quotation marks where needed.
Also, check the actual MySQL. If it contains things like double quotation
marks or greater- or less-than tags, it may be misinterpreted by your
browser when output. A line like:
could come out like:
<>$%#$" there
it
's it gives me errors. I take
them out of the sql text and webpage and it works fine.
From: "John W. Holmes" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: "'Tyler Durdin'" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: RE: [PHP]
> I have a web page with a simple introductory paragraph on it. I was
going
> to
> store the paragraph in a mySQL DB and create an administration page so
> people could easily edit the paragraph itself or change it all
together.
> The
> problem I ran into is that mySQL will not allow certain punctu
9 matches
Mail list logo