动态网页技术PHP通过参数来生成MYSQL语句类(9) if ( $this -> getConditions()) { if ( ! $this -> BuildCondition()){ $this -> dbgFailed( $funct ); return ;} $sql .= " WHERE " . $this -> getCondition(); } $this -> Result = $sql ; return true ; } function getInsertSQL() { $funct = " getInsertSQL " ; $className = get_class ( $this ); if ( ! $this -> getValues()){ $this -> Error = " $className::$funct \nProperty Values was empty " ; return ;} if ( ! $this -> getFields()){ $this -> Error = " $className::$funct \nProperty Fields was empty " ; return ;} if ( ! $this -> getTables()){ $this -> Error = " $className::$funct \nProperty Tables was empty " ; return ;} if ( ! $this -> CombineFieldValue()){ $this -> dbgFailed( $funct ); return ;} $Tables = $this -> getTables(); $sql = " INSERT INTO " . $Tables [ 0 ] . " ( " . $this -> fieldSQL . " ) VALUES ( " . $this -> valueSQL . " ) " ; $this -> Result = $sql ; return true ; } function getUpdateSQL() { $funct = " getUpdateSQL " ; $className = get_class ( $this ); if ( ! $this -> getValues()){ $this -> Error = " $className::$funct \nProperty Values was empty " ; return ;} if ( ! $this -> getFields()){ $this -> Error = " $className::$funct \nProperty Fields was empty " ; return ;} if ( ! $this -> getTables()){ $this -> Error = " $className::$funct \nProperty Tables was empty " ; return ;} if ( ! $this -> CombineFieldValue()){ $this -> dbgFailed( $funct ); return ;}