Fw: [PHP] Number Sign in String Variables
| From: | Rick Emery | Date: | Fri, 17 Jan 2003 22:25:24 +0000 |
| Subject: | Fw: [PHP] Number Sign in String Variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-132048@lists.php.net to get a copy of this message | ||
I have data that have #, so that is not the problem.
Show us more code AND your database structure.
----- Original Message -----
From: "Joab Ben Stieglitz" <jstieglitz@st-i-e-g.org>
To: <>
Sent: Friday, January 17, 2003 2:25 PM
Subject: [PHP] Number Sign in String Variables
I have a MySQL database that includes data with the # sign in some data
fields. My PHP script pulls the data out of the database fine, but when I
got to write back to the database, I get errors because the string gets
truncated at the # sign. For example:
$query = "INSERT INTO order_detail
SET customer_id = -1,
order_id = $order_no,
item_id = $item_id,
item_num = \"$item_num\",
unit = \"$unit\",
short_desc = \"$short_desc\",
quantity = $quantity,
wholesaler = \"$wholesaler\",
cost = $cost,
sale_price = $sale_price";
This statement fails if $short_desc contains a # sign. The string stops at
the # sign, and all the subsequent fields are empty or garbage.
None of the various resources I have looked at indicate that the # sign is a
special character. Any suggestions?
--
Joab Ben Stieglitz
jstieglitz@st-i-e-g.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php