RE: [PHP] updating pages with php

2003-03-05 Thread John W. Holmes
 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 punctuation
inside
 of a record (no comma's). So now I am left trying to figure out how I
can
 have the user update the paragraph without having it in a db. Can
someone
 shoot me in the proper direction? Thanks in advance, your help is
greatly
 appreciated.

MySQL will allow any characters; the problem is in your code. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] updating pages with php

2003-03-05 Thread Tyler Durdin
When I take the comma's out it works. then I try to put them back in and it 
will not work.

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.





From: John W. Holmes [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: 'Tyler Durdin' [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: RE: [PHP] updating pages with php
Date: Wed, 5 Mar 2003 13:23:00 -0500
 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 punctuation
inside
 of a record (no comma's). So now I am left trying to figure out how I
can
 have the user update the paragraph without having it in a db. Can
someone
 shoot me in the proper direction? Thanks in advance, your help is
greatly
 appreciated.
MySQL will allow any characters; the problem is in your code.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] updating pages with php

2003-03-05 Thread Liam Gibbs
The problem I ran into is that mySQL will not allow certain punctuation
inside of a record (no comma's). So now I am left trying to figure out how I
can have the user update the paragraph without having it in a db. Can
someone shoot me in the proper direction? Thanks in advance, your help is
greatly appreciated.

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:

INPUT TYPE = TEXT VALUE = $result[0]

could come out like:

INPUT TYPE = TEXT VALUE = Example text that screws up $%#$ there
it is

or even in non-form tags.

Try checking both MySQL and the output code in your browser.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] updating pages with php

2003-03-05 Thread Liam Gibbs
 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 problem can't be with the commas. Post the query here, or try an SQL
list.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] updating pages with php

2003-03-05 Thread Tyler Durdin


$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
Date: Wed, 5 Mar 2003 13:33:11 -0500
 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 problem can't be with the commas. Post the query here, or try an SQL
list.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] updating pages with php

2003-03-05 Thread Liam Gibbs
 $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, visit: http://www.php.net/unsub.php



Re: [PHP] updating pages with php

2003-03-05 Thread Tyler Durdin
They are all text fields. Intro title is just a line of text that says 
Welcome to this website... Intro, is the text of the introduction.

You are correct and it is apostophe's and not comma's that cause the error. 
What do I do to get around that?





From: Liam Gibbs [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';
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, visit: http://www.php.net/unsub.php


_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] updating pages with php

2003-03-05 Thread Brent Baisley
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))

The nl2br() function will change all new lines (returns) to the html 
equivalent br /.

On Wednesday, March 5, 2003, at 01:19 PM, Tyler Durdin wrote:

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 
punctuation inside of a record (no comma's). So now I am left trying to 
figure out how I can have the user update the paragraph without having 
it in a db. Can someone shoot me in the proper direction? Thanks in 
advance, your help is greatly appreciated.

bk



_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

-- PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] updating pages with php

2003-03-05 Thread Liam Gibbs
You are correct and it is apostophe's and not comma's that cause the
error. What do I do to get around that?

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/unsub.php