Changeset 621 for trunk/phpbms/include
- Timestamp:
- 06/25/09 17:55:57 (3 years ago)
- Location:
- trunk/phpbms/include
- Files:
-
- 2 modified
-
search_class.php (modified) (4 diffs)
-
tables.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/include/search_class.php
r599 r621 294 294 $this->db->logError=false; 295 295 $this->db->stopOnError=false; 296 //echo "<pre>"; 297 //var_dump($_SESSION["thequerystatement"]); 298 //exit; 296 299 297 $this->queryresult = $this->db->query($_SESSION["thequerystatement"]); 300 298 … … 1221 1219 1222 1220 1223 function delete_record(){ 1224 1225 $whereclause=$this->buildWhereClause(); 1221 function delete_record($useUUID = false){ 1222 1223 if(!$useUUID) 1224 $whereclause=$this->buildWhereClause(); 1225 else 1226 $whereclause = $this->buildWhereClause($this->maintable.".uuid"); 1226 1227 1227 1228 $endmessage=""; … … 1236 1237 $endmessage=" deleted"; 1237 1238 } 1239 1238 1240 $queryresult = $this->db->query($querystatement); 1239 1241 $message = $this->buildStatusMessage().$endmessage; … … 1252 1254 $whereclause=""; 1253 1255 foreach($idsArray as $theid){ 1254 $whereclause.=" OR ".$fieldphrase."= ".$theid;1256 $whereclause.=" OR ".$fieldphrase."='".$theid."'"; 1255 1257 } 1256 1258 $whereclause=substr($whereclause,3); -
trunk/phpbms/include/tables.php
r609 r621 504 504 505 505 /** 506 * function updateRecord 507 * 506 508 * updates a record 507 509 * … … 510 512 * If the modified is not passed or is NULL the function will use 511 513 * the currently logged in user. 512 * @param bool $useUuid specifies whther t he $id is a uuid (true) or not. Default is false.514 * @param bool $useUuid specifies whther to use the id or the uuid (true) in the whereclause. Default is false. 513 515 * 514 516 * @return bool true or false depending upon update success … … 582 584 $updatestatement .= " 583 585 WHERE 584 `uuid` = '".mysql_real_escape_string($variables[" id"])."'";586 `uuid` = '".mysql_real_escape_string($variables["uuid"])."'"; 585 587 586 588 }//endif … … 600 602 * @param bool $overrideID 601 603 * @param bool $replace use the SQL replace statement (true) instead of insert (false, deault) 602 * @param bool $useUuid generates a uuid and specifies the function to retrn thean array with uuid and id instead of just the id604 * @param bool $useUuid generates a uuid and specifies the function to retrn an array with uuid and id instead of just the id 603 605 * 604 606 * @return int|array|bool retruns the id of the newly created record of false on error. If $useUuid is set to true, it will … … 624 626 switch($fieldname){ 625 627 case "id": 626 if($overrideID && $variables["id"]){ 627 628 $fieldlist .= "id, "; 629 $insertvalues .= ((int) $variables["id"]).", "; 628 if($overrideID && isset($variables["id"])){ 629 630 if($variables["id"]){ 631 $fieldlist .= "id, "; 632 $insertvalues .= ((int) $variables["id"]).", "; 633 }//end if 630 634 631 635 }//endif … … 678 682 679 683 $fieldlist .= "`uuid`, "; 680 $insertvalues .= "'".uuid($this->prefix.":")."', "; 684 $variables["uuid"] = uuid($this->prefix.":"); 685 $insertvalues .= "'".$variables["uuid"]."', "; 681 686 682 687 }//endif