[Vtigercrm-commits] [vtiger-commits] r6140 - /vtigercrm/trunk/modules/Accounts/Save.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed May 17 23:03:30 EDT 2006


Author: jeffk
Date: Wed May 17 21:03:27 2006
New Revision: 6140

Log:
refs #795. SQL formatting

Modified:
    vtigercrm/trunk/modules/Accounts/Save.php

Modified: vtigercrm/trunk/modules/Accounts/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/Save.php (original)
+++ vtigercrm/trunk/modules/Accounts/Save.php Wed May 17 21:03:27 2006
@@ -111,15 +111,15 @@
 	$log->debug("Entering save_customfields(".$entity_id.") method ...");
 	$log->info("save customfields invoked");
 	global $adb;
-	$dbquery="select * from customfields where module='Accounts'";
+	$dbquery = "SELECT * FROM customfields WHERE module = 'Accounts'";
         /*
 	$result = mysql_query($dbquery);
-	$custquery = 'select * from accountcf where accountid="'.$entity_id.'"';
+	$custquery = "SELECT * FROM accountcf WHERE accountid = '".$entity_id."'";
         $cust_result = mysql_query($custquery);
 	if(mysql_num_rows($result) != 0)
         */
 	$result = $adb->query($dbquery);
-	$custquery = "select * from accountcf where accountid='".$entity_id."'";
+	$custquery = "SELECT * FROM accountcf WHERE accountid = '".$entity_id."'";
         $cust_result = $adb->query($custquery);
 	if($adb->num_rows($result) != 0)
 	{
@@ -185,16 +185,13 @@
                   if(isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $adb->num_rows($cust_result) !=0)
 		{
 			//Update Block
-                  //$query = 'update accountcf SET '.$update.' where accountid="'.$entity_id.'"'; 
-                  //mysql_query($query);
-                        $query = 'update accountcf SET '.$update." where accountid='".$entity_id."'"; 
+                        $query = "UPDATE accountcf SET ".$update." WHERE accountid='".$entity_id."'"; 
 			$adb->query($query);
 		}
 		else
 		{
 			//Insert Block
-			$query = 'insert into accountcf ('.$columns.') values('.$values.')';
-			//mysql_query($query);
+			$query = "INSERT INTO accountcf (".$columns.") VALUES(".$values.")";
                         $adb->query($query);
 		}
 		
@@ -211,7 +208,7 @@
 		else
 		{
 			//Insert Block
-			$query = 'insert into accountcf ('.$columns.') values('.$values.')';
+			$query = "INSERT INTO accountcf (".$columns.") VALUES(".$values.")";
                         $adb->query($query);
 			//mysql_query($query);
 		}





More information about the vtigercrm-commits mailing list