Re: [PHP-DB] Escaping an '
Mysql_real_escape_string($bar) Bastien Koert 905-904-0334 Sent from my iPhone On 2010-10-16, at 10:41 PM, Ron Piggott ron.pigg...@actsministries.org wrote: For a query similar to: SELECT * FROM `tablle` WHERE `column` LIKE 'Sally's Hair Parlor' how do I escape the ' for 's? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Escaping an '
For a query similar to: SELECT * FROM `tablle` WHERE `column` LIKE 'Sally's Hair Parlor' how do I escape the ' for 's?
[PHP-DB] Escaping Characters help needed
Hi there everyone, Can any of you see why the below will not insert into my database? Hann Heritage Homes' Fall Circuit entry. Fabulous ranch floorplan w/walkout basement. Stunning great room w/FP, dramatic dining room, den, screened porch. Mullett kitchen with glazed birch cabinets and granite. Luxury master BR and bath. The finest materials and workmanship throughout. Interiors by Pine Tree Barn. Compare and you'll choose to build with Hann Heritage Homes! I'm using PHP with MySQL and I store the data in $marketremarks but when it gets to THIS FIELD with this particular data in it, it just won't insert. I use the below to escape the characters, but I'm missing something or doing something wrong? addslashes(trim($marketremarks)); Any help would REALLY be appreciated. Thanks everyone, Chris -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.2/105 - Release Date: 9/19/2005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Escaping Characters help needed
look at: mysql_escape_string(); On Friday 23 September 2005 2:28 pm, Chris Payne wrote: Hi there everyone, Can any of you see why the below will not insert into my database? Hann Heritage Homes' Fall Circuit entry. Fabulous ranch floorplan w/walkout basement. Stunning great room w/FP, dramatic dining room, den, screened porch. Mullett kitchen with glazed birch cabinets and granite. Luxury master BR and bath. The finest materials and workmanship throughout. Interiors by Pine Tree Barn. Compare and you'll choose to build with Hann Heritage Homes! I'm using PHP with MySQL and I store the data in $marketremarks but when it gets to THIS FIELD with this particular data in it, it just won't insert. I use the below to escape the characters, but I'm missing something or doing something wrong? addslashes(trim($marketremarks)); Any help would REALLY be appreciated. Thanks everyone, Chris -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.2/105 - Release Date: 9/19/2005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Escaping Characters help needed
Just out of curiosity, your method looks like it should work, what's the mysql error message? -Micah On Friday 23 September 2005 2:28 pm, Chris Payne wrote: Hi there everyone, Can any of you see why the below will not insert into my database? Hann Heritage Homes' Fall Circuit entry. Fabulous ranch floorplan w/walkout basement. Stunning great room w/FP, dramatic dining room, den, screened porch. Mullett kitchen with glazed birch cabinets and granite. Luxury master BR and bath. The finest materials and workmanship throughout. Interiors by Pine Tree Barn. Compare and you'll choose to build with Hann Heritage Homes! I'm using PHP with MySQL and I store the data in $marketremarks but when it gets to THIS FIELD with this particular data in it, it just won't insert. I use the below to escape the characters, but I'm missing something or doing something wrong? addslashes(trim($marketremarks)); Any help would REALLY be appreciated. Thanks everyone, Chris -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.2/105 - Release Date: 9/19/2005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] escaping line brakes
Hi there, I am putting text into a mysql db from a form field. I do include the linebrakes with line2br. Now I would like to create an interface where I could load the text into the form again to edit it. Unfortunatelly it includes some wired chars like \br into the text. How can I get rid of that? Thanx for any help, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] escaping line brakes
From: Andy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 16, 2002 2:45 PM Hi there, I am putting text into a mysql db from a form field. I do include the linebrakes with line2br. Now I would like to create an interface where I could load the text into the form again to edit it. Unfortunatelly it includes some wired chars like \br into the text. How can I get rid of that? When did you use nl2br() (which I assume you mean)? Before you store the the data in the database or when you retrive it? If before then use echo str_replace(br /, \n, $your_string) If when you retrieve the data for output to the form, then just don't use nl2br(). Regards Joakim Andersson Thanx for any help, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Escaping queries in php using InterBase
Hello, I'm in trouble with my current project which uses Interbase as backend. (php.ini: magic_quotes_sybase = On) When I insert a string containing a ', like Beverly D'Angelo, php saves it with two ' When I insert it with two ', it gets saved with four ' Short: php multiplies all the ' by factor 2. e.g.: Select after inserting the string: Beverly D''Angelo Select after first update Beverly DAngelo Select after second update Beverly DAngelo Select after third update Beverly DAngelo What can I do? I do not want to write an ugly function to handle this, isn't there something php/ib-native thank you, yves -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Escaping queries in php using InterBase
On Wed, 22 Aug 2001, Yves Glodt wrote: Hello, I'm in trouble with my current project which uses Interbase as backend. (php.ini: magic_quotes_sybase = On) When I insert a string containing a ', like Beverly D'Angelo, php saves it with two ' When I insert it with two ', it gets saved with four ' [...] I have always wondered why there is no mysql specifig quoting functions in php. Here is what I use: function myslashes($content = ) { $content = str_replace(\\,,$content); $content = str_replace(',\\',$content); return $content; } I guess Interbase also uses backslash for quoting? -- patrik wallstrom | f o o d f i g h t tel: +46-8-6188428 | s t o c k h o l m gsm: +46-709580442 | - - - - - - - - - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Escaping
Thanks to all for your help. I had to step away for a while yesterday so I am just now getting back to your responses. Here is what I was having a problem with: a href=\sales_location.php?Customer=$Customer\ target=bottom_right$Customer/a Based on your responses, here is what I have now (this works!): a href=\sales_location.php?Customer= . urlencode($Customer) .\ target=bottom_right$Customer/a As you can see, urlencode did the trick. Thanks again everybody!! Randy Rankin -Original Message- From: Ken Sommers [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 10:27 PM To: Rankin, Randy; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Escaping Please explain the dynamic link . is that in the documentation somewhere? Kne - Original Message - From: Rankin, Randy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 8:18 AM Subject: [PHP-DB] Escaping Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? TIA, Randy Rankin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Escaping
Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? TIA, Randy Rankin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Escaping
When they click on the link what is happening? Is it doing a query in the database for all users with that name? If so you may want to do a str_replace('','\','customer_name') before your query. Basically you just want to add the \ before the ampersand. I haven't tried this but it SHOULD work. Roger On Thu, 12 Jul 2001, Rankin, Randy wrote: Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? TIA, Randy Rankin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Escaping
try using the SUBSTR function to check each string for the first char as a . if it does have it, strip and continue the process... Rankin, Randy wrote: Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Escaping
Please explain the dynamic link . is that in the documentation somewhere? Kne - Original Message - From: Rankin, Randy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 8:18 AM Subject: [PHP-DB] Escaping Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? TIA, Randy Rankin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Escaping
dynamic link, i think he means something like echo a href=\customer_details.php?customer=$customer\Customer/a\n; or whatever, and as for making it so that you can include a in the $customer variable in the example above, try this; echo a href=\customer_details.php?customer= . urlencode($customer) . \Customer/a\n; /beau // -Original Message- // From: Ken Sommers [mailto:[EMAIL PROTECTED]] // Sent: Friday, 13 July 2001 11:27 AM // To: Rankin, Randy; [EMAIL PROTECTED] // Subject: Re: [PHP-DB] Escaping // // // Please explain the dynamic link . // is that in the documentation somewhere? // // Kne // - Original Message - // From: Rankin, Randy [EMAIL PROTECTED] // To: [EMAIL PROTECTED] // Sent: Thursday, July 12, 2001 8:18 AM // Subject: [PHP-DB] Escaping // // // Hello, // // I have a table in a MySQL DB (RH Linux/Apache) with a field called // customer_name. Some of the customer names have an // ampersand in them (ie; X // // X Supply). I am performing a select statement on this // table to create a // sales summary with customer name and total sales. // // This works fine; however, I am also creating a dynamic link on the // customer // name so that the user can click on it to get a detailed // report of sales to // that customer. This works great EXCEPT for the customers // with ampersands // in // thier names. The result of clicking on these customers // indicates a No // Records found for X where X is the letter immediately // preceding the // ampersand. // // Does anyone know how to get around this? // // TIA, // // Randy Rankin // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Escaping
I think he just means a hypertext anchor, that contains a string identifying the record. A HREF=fun.php?id=$id -Original Message- From: Ken Sommers [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 11:27 PM To: Rankin, Randy; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Escaping Please explain the dynamic link . is that in the documentation somewhere? Kne - Original Message - From: Rankin, Randy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 12, 2001 8:18 AM Subject: [PHP-DB] Escaping Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? TIA, Randy Rankin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]