CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> Wishes

 CCToSQL with ccsInteger returns float

Print topic Send  topic

Author Message

Posts: 8
Posted: 03/08/2010, 11:46 PM

Today I tried to check if an array key exists:

$id = CCToSQL(CCGetFromGet('id'), ccsInteger);  
if (array_key_exists($id, $testArray)) {  
  // do smth.  

This code doesn't work, because array_key_exists expects either an int or a string, instead CCToSQL returns a float.

Can this be changed? Suggestion:

function CCToSQL($Value, $ValueType) {  
  if(!strlen($Value)) {  
    return "NULL";  
  else {  
    if($ValueType == ccsInteger) {  
      return intval($Value);  
    else if ($ValueType == ccsFloat) {  
      return doubleval(str_replace(",", ".", $Value));  
    else {  
      return "'" . str_replace("'", "''", $Value) . "'";  
View profile  Send private message
Posted: 03/09/2010, 5:53 AM


Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.