PHP Classes

confused

Recommend this page to a friend!

      Ultimate MySQL  >  All threads  >  confused  >  (Un) Subscribe thread alerts  
Subject:confused
Summary:Problem with SQLValue
Messages:1
Author:e sm
Date:2008-06-07 23:28:58
 

  1. confused   Reply   Report abuse  
Picture of e sm e sm - 2008-06-07 23:28:58
if I have the following:
$values["Name"] = MySQL::SQLValue("Violet's time");

the value of name in a sql statement has the following value:

Violet''s time [***the single quote is now two single quotes***]


for a string, the SQLValue function has the following:

case "text":
case "string":
case "varchar":
case "char":
if (strlen($value) == 0) {
$return_value = "NULL";
} else {
$return_value = "'" . str_replace("'", "''", $value) . "'";
}
break;

it replaces one single quote with two single quotes.

that seems wrong. what am i missing...???


.