Apostrophe string in mssql

Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards -- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us. Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo

*$foo = "This is Murang'a town"; $sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";* On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com> wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu | STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View

@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005 On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu <imogetutu@googlemail.com>wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com> wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us. Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo

*INSERT myTable (columnName) VALUES ('This is Murang''a')* This will insert a single quote or apostrophe into the field between the "g" and the "a". --not tested On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com> wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu <imogetutu@googlemail.com
wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View

Because am doing an insert from an application is there a way I can do string repalce such that i whenever a name like Murang'a appears the ' will have to be repalced by ' ' ( two apostrophes) Thanks On Mon, Sep 20, 2010 at 11:18 AM, Isaak Mogetutu <imogetutu@googlemail.com>wrote:
*INSERT myTable (columnName) VALUES ('This is Murang''a')*
This will insert a single quote or apostrophe into the field between the "g" and the "a".
--not tested
On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com> wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us. Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo

You should *always* use parameterized statements for this sort of work. Besides sparing you the trouble of having to escape special characters, it is a good defence against SQL Injection On Mon, Sep 20, 2010 at 11:23 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Because am doing an insert from an application is there a way I can do string repalce such that i whenever a name like Murang'a appears the ' will have to be repalced by ' ' ( two apostrophes) Thanks
On Mon, Sep 20, 2010 at 11:18 AM, Isaak Mogetutu <imogetutu@googlemail.com
wrote:
*INSERT myTable (columnName) VALUES ('This is Murang''a')*
This will insert a single quote or apostrophe into the field between the "g" and the "a".
--not tested
On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com>wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

That will heavily depend on whic application you are working with classic ASP, VBScript => Replace(varString, "'", "''") Im not sure on the .Net frontier On Mon, Sep 20, 2010 at 11:23 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Because am doing an insert from an application is there a way I can do string repalce such that i whenever a name like Murang'a appears the ' will have to be repalced by ' ' ( two apostrophes) Thanks
On Mon, Sep 20, 2010 at 11:18 AM, Isaak Mogetutu <imogetutu@googlemail.com
wrote:
*INSERT myTable (columnName) VALUES ('This is Murang''a')*
This will insert a single quote or apostrophe into the field between the "g" and the "a".
--not tested
On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com>wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Am working on a php mssql app, please can you give me an exapmle of parametrized in the Murang'a case am using php $address=$_POST("Address") This address contains MURANG'A with an apostrophe Regards On Mon, Sep 20, 2010 at 11:53 AM, Nd'wex Common <flexycat@gmail.com> wrote:
That will heavily depend on whic application you are working with classic ASP, VBScript => Replace(varString, "'", "''")
Im not sure on the .Net frontier
On Mon, Sep 20, 2010 at 11:23 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Because am doing an insert from an application is there a way I can do string repalce such that i whenever a name like Murang'a appears the ' will have to be repalced by ' ' ( two apostrophes) Thanks
On Mon, Sep 20, 2010 at 11:18 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*INSERT myTable (columnName) VALUES ('This is Murang''a')*
This will insert a single quote or apostrophe into the field between the "g" and the "a".
--not tested
On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com>wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us. Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo

**$varString = $_POST['Address']; str_replace("'", "''", $varString); On Mon, Sep 20, 2010 at 12:09 PM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Am working on a php mssql app, please can you give me an exapmle of parametrized in the Murang'a case am using php $address=$_POST("Address") This address contains MURANG'A with an apostrophe Regards
On Mon, Sep 20, 2010 at 11:53 AM, Nd'wex Common <flexycat@gmail.com>wrote:
That will heavily depend on whic application you are working with classic ASP, VBScript => Replace(varString, "'", "''")
Im not sure on the .Net frontier
On Mon, Sep 20, 2010 at 11:23 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Because am doing an insert from an application is there a way I can do string repalce such that i whenever a name like Murang'a appears the ' will have to be repalced by ' ' ( two apostrophes) Thanks
On Mon, Sep 20, 2010 at 11:18 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*INSERT myTable (columnName) VALUES ('This is Murang''a')*
This will insert a single quote or apostrophe into the field between the "g" and the "a".
--not tested
On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com>wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*$foo = "This is Murang'a town";
$sql = "INSERT INTO mytable SET comments = '".mysql_real_escape_string($foo)."'";*
On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote:
> Hi Techies, > How do we insert words like > 'Murang'a' in mssql as it will be seen as an unclosed quote > Regards > > -- > Our greatest fear is not that we are inadequate, > but that we are powerful beyond measure. > It is our light, not our darkness, that frightens us. > > Calvin Omari Systems Developer/Designer > http://www.facebook.com/barongo > > _______________________________________________ > Skunkworks mailing list > Skunkworks@lists.my.co.ke > http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks > ------------ > Skunkworks Server donations spreadsheet > > http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... > ------------ > Skunkworks Rules > http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 > ------------ > Other services @ http://my.co.ke >
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Great this worked and i also used tried the following function escapeSingleQuotes($string){ //escapse single quotes $singQuotePattern = "'"; $singQuoteReplace = "''"; return(stripslashes(eregi_replace($singQuotePattern, $singQuoteReplace, $string))); } On Mon, Sep 20, 2010 at 12:30 PM, Nd'wex Common <flexycat@gmail.com> wrote:
**$varString = $_POST['Address']; str_replace("'", "''", $varString);
On Mon, Sep 20, 2010 at 12:09 PM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Am working on a php mssql app, please can you give me an exapmle of parametrized in the Murang'a case am using php $address=$_POST("Address") This address contains MURANG'A with an apostrophe Regards
On Mon, Sep 20, 2010 at 11:53 AM, Nd'wex Common <flexycat@gmail.com>wrote:
That will heavily depend on whic application you are working with classic ASP, VBScript => Replace(varString, "'", "''")
Im not sure on the .Net frontier
On Mon, Sep 20, 2010 at 11:23 AM, Calvin Omari <calvinebarongo@gmail.com
wrote:
Because am doing an insert from an application is there a way I can do string repalce such that i whenever a name like Murang'a appears the ' will have to be repalced by ' ' ( two apostrophes) Thanks
On Mon, Sep 20, 2010 at 11:18 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
*INSERT myTable (columnName) VALUES ('This is Murang''a')*
This will insert a single quote or apostrophe into the field between the "g" and the "a".
--not tested
On 20 September 2010 11:13, Calvin Omari <calvinebarongo@gmail.com>wrote:
@Isaak Thanks so much do we have the same syntax in Microsoft sql server 2005
On Mon, Sep 20, 2010 at 11:10 AM, Isaak Mogetutu < imogetutu@googlemail.com> wrote:
> *$foo = "This is Murang'a town"; > > $sql = "INSERT INTO mytable SET comments = > '".mysql_real_escape_string($foo)."'";* > > On 20 September 2010 11:03, Calvin Omari <calvinebarongo@gmail.com>wrote: > >> Hi Techies, >> How do we insert words like >> 'Murang'a' in mssql as it will be seen as an unclosed quote >> Regards >> >> -- >> Our greatest fear is not that we are inadequate, >> but that we are powerful beyond measure. >> It is our light, not our darkness, that frightens us. >> >> Calvin Omari Systems Developer/Designer >> http://www.facebook.com/barongo >> >> _______________________________________________ >> Skunkworks mailing list >> Skunkworks@lists.my.co.ke >> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks >> ------------ >> Skunkworks Server donations spreadsheet >> >> http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... >> ------------ >> Skunkworks Rules >> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 >> ------------ >> Other services @ http://my.co.ke >> > > > > -- > mOgetutu > > | STOP! Before posting your questions, remember the WWW Golden rule: > What did you try? What did you get? What did you expect to get? > | Input -> Controller | Processing -> Model | Output -> View > > > _______________________________________________ > Skunkworks mailing list > Skunkworks@lists.my.co.ke > http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks > ------------ > Skunkworks Server donations spreadsheet > > http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... > ------------ > Skunkworks Rules > http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 > ------------ > Other services @ http://my.co.ke >
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- mOgetutu
| STOP! Before posting your questions, remember the WWW Golden rule: What did you try? What did you get? What did you expect to get? | Input -> Controller | Processing -> Model | Output -> View
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us. Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo

Either 'Murang''a' or 'Murang\'a' should do it. But if you inserting from an app, use parameterized queries. On Mon, Sep 20, 2010 at 11:03 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Regards Brian Ngure

i do not know about mssql but in mysql we insert '\' before the apostrophe so murang'a will be murang\'a. alternatively try insering it as a variable. On Mon, Sep 20, 2010 at 11:03 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

@calvin This would do: http://tipsandtricks.nogoodatcoding.com/2007/07/escape-character-in-microsof... On Mon, Sep 20, 2010 at 11:03 AM, Calvin Omari <calvinebarongo@gmail.com>wrote:
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

'murang''a' ? Jangita | +254 76 918383 | MSN & Y!: jangita@yahoo.com Skype: jangita | GTalk: jangita.nyagudi@gmail.com From: skunkworks-bounces@lists.my.co.ke [mailto:skunkworks-bounces@lists.my.co.ke] On Behalf Of Calvin Omari Sent: 20 September 2010 10:03 AM To: Skunkworks Forum Subject: [Skunkworks] Apostrophe string in mssql Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards -- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us. Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo

Just use prepared statements, what someone else called parameterized queries. They are more flexible and not prone to sql injections. On Mon, Sep 20, 2010 at 2:20 PM, Jangita <jangita@jangita.com> wrote:
'murang''a' ?
Jangita | +254 76 918383 | MSN & Y!: jangita@yahoo.com Skype: jangita | GTalk: jangita.nyagudi@gmail.com
From: skunkworks-bounces@lists.my.co.ke [mailto:skunkworks-bounces@lists.my.co.ke] On Behalf Of Calvin Omari Sent: 20 September 2010 10:03 AM To: Skunkworks Forum Subject: [Skunkworks] Apostrophe string in mssql
Hi Techies, How do we insert words like 'Murang'a' in mssql as it will be seen as an unclosed quote Regards
-- Our greatest fear is not that we are inadequate, but that we are powerful beyond measure. It is our light, not our darkness, that frightens us.
Calvin Omari Systems Developer/Designer http://www.facebook.com/barongo
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Solomon Kariri, Software Developer, Cell: +254736 729 450 Skype: solomonkariri
participants (8)
-
Brian Ngure
-
Brian Rioba
-
Calvin Omari
-
Isaak Mogetutu
-
Jangita
-
Nd'wex Common
-
Rad!
-
solomon kariri