RE: [PHP] Displaying data from a MySLQ table

From: Date: Fri, 30 Jun 2006 20:14:22 +0000
Subject: RE: [PHP] Displaying data from a MySLQ table
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-239021@lists.php.net to get a copy of this message
Ok, better but stil not displayting properly. Here is what my database field has: import.csv'<">/\ Here is what is displaying: import.csv'</\" size="40" maxlength="40" onkeypress="return noenter()"> It's choking on the double quote in the database field. Here is the code snippet from my form: <input type="text" name="email" value="<?php echo display_database($db_accounting->Email); ?>" size="50"></td> function display_database($value) { $value = htmlentities($value,ENT_COMPAT); if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } return $value; } -----Original Message----- From: Stut [mailto:stuttle@gmail.com] Sent: Friday, June 30, 2006 3:49 PM To: Don Cc: php list Subject: Re: [PHP] Displaying data from a MySLQ table Don wrote: > Hi Have have a varchar field in a MySQL database which contains the > following > > 905.362.6000"l""s"'L' > > I am trying to display it on my web page in a <INPUT="TEXT"> field but > all I see is: > > 905.362.6000 > > I am wondering why the trailing characters do not display even though > they are present in the database when I check using PhpMyAdmin. Please help. You need to run the value through htmlentities (http://php.net/htmlentities).

« previous php.general (#239021) next »