Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mysql_real_escape_string for nodejs

function mysql_real_escape_string (str) {
    return str.replace(/[x08x09x1a

"'\%]/g, function (char) {
        switch (char) {
            case "":
                return "";
            case "x08":
                return "";
            case "x09":
                return "	";
            case "x1a":
                return "z";
            case "
":
                return "
";
            case "
":
                return "
";
            case """:
            case "'":
            case "":
            case "%":
                return ""+char; // prepends a backslash to backslash, percent,
                                  // and double/single quotes
        }
    });
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery vertical scroll 
Javascript :: how to target checkbox in jquery 
Javascript :: date format in moment js 
Javascript :: How to end a session in ExpressJS 
Javascript :: overflowy javascript 
Javascript :: how to find last element of an array 
Javascript :: destructuring an object js 
Javascript :: ajax file upload input 
Javascript :: how to remove first element from array in javascript 
Javascript :: react recoil 
Javascript :: javascript Create Strings 
Javascript :: math.floor 
Javascript :: create an empty array js 
Javascript :: get channel object using its name discod.js 
Javascript :: remove duplicate values from array 
Javascript :: angular style component tag 
Javascript :: show image javascript 
Javascript :: fingerprint js 
Javascript :: byte number to array js 
Javascript :: javascript on screen width change 
Javascript :: array flatten 
Javascript :: Custom JavaScript URL Builder 
Javascript :: Turn on modern JS by adding use strict to your script 
Javascript :: convert div to image and download jquery 
Javascript :: javascript delete user input value in array 
Javascript :: map javascript 
Javascript :: set array length js 
Javascript :: nodejs import readline 
Javascript :: detect dark mode 
Javascript :: javascript for of loop 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =