You should always use parameterized statements for this sort of work.
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 testedOn 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 2005On 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-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
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-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
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-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
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-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
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-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke