ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
Re: [PHP-DB] short text strings with apostrophes and forms
by Luis Morales other posts by this author
Apr 20 2006 9:22AM messages near this date
[PHP-DB] short text strings with apostrophes and forms | Re: [PHP-DB] short text strings with apostrophes and forms
Jeffry,

I suggest use htmlentities/html_entity_decode functions. For example to
update the db with values use:

$myCol = htmlentities($mycol_value);

Ej: query

$query = "update my_table set myCol='{$myCol}' where id = 'id_val'";

Now when your application restore the data from the db you can use:

$mycol_value = html_entity_decode ($myCol);


$mycol_value: is the value from html form
$myCol: is the name of your colum's table to update in your query.

Good luck,

Regards,

Luis Morales 


On Thu, 2006-04-20 at 17:56 +0200, Jeffrey wrote:
>  I have an application which calls up some data from a MySQL table and 
>  puts it into a web form for users to modify.
>  
>  One of the cells holds a text string which is put into a text input 
>  field. However, if that text string includes an apostrophe, all text 
>  after the apostrophe disappears.
>  
>  For example, if the test string from a database cell reads...
>  
>  Fix the managers' cars by Tuesday
>  
>  and that is saved in the variable $some_text, which is called up in a 
>  form...
>  
>  <input type='text' name='some_variable' value='$some_text'>
>  
>  The text field on the web page will only contain...
>  
>  Fix the managers
>  
>  How can I get the text field to show the entire string?
>  
>  Many thanks,
>  
>  Jeffrey
>  
-- 
---------------------------------------------------------------------------------
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
---------------------------------------------------------------------------------
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
---------------------------------------------------------------------------------

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Jeffrey
Luis Morales
dpgirago
Richard Leclair
Charlie van de Kerkhof

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved