PHP Classes


Recommend this page to a friend!
  Classes of Michael J. Fuhrman  >  Ladder PHP  >  >  Download  
Role: Documentation
Content type: text/plain
Description: This contains the SQLEncode Command
Class: Ladder PHP
Manage objects stored MySQL database dynamically
Author: By
Last change: Informed users which file this code segment should be placed in.
Date: 6 years ago
Size: 513 bytes


Class file image Download
Ladder PHP requires SQLEnclode or mysql_real_escape_string to be used to encode SQL calls.  mysql_real_escape_string is faster, as it's compiled into PHP.  

Add the code below to your Functions.INC file.

Function SQLEncode ($szString)
   $szRtn = "";
   $nlen = strLen($szString);
   If ($nlen == 0) return;

   For ($t = 0; $t < $nlen; $t++)
      $szChar = substr($szString, $t, 1);
      $szRtn .= $szChar;
      If ($szChar == "'") $szRtn .= $szChar;

   return ($szRtn);