| version 1.202, 2007/09/10 08:40:48 |
version 1.203, 2007/09/12 15:02:46 |
|
|
| * http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.201 2007-09-08 11:47:22 michal Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.202 2007-09-10 08:40:48 michal Exp $ */ |
| |
|
| /* This is a generic table editing program. The table and fields to be |
/* This is a generic table editing program. The table and fields to be |
| edited are defined in the calling program. |
edited are defined in the calling program. |
|
|
| { |
{ |
| is_numeric($field) || $field = array_search($field, $this->fds); |
is_numeric($field) || $field = array_search($field, $this->fds); |
| // if read SQL expression exists use it |
// if read SQL expression exists use it |
| if ($this->col_has_sql($field)) |
if ($this->col_has_sql($field) && !$this->col_has_values($field)) |
| return $this->fdd[$field]['sql']; |
return $this->fdd[$field]['sql']; |
| // on copy/change always use simple key retrieving |
// on copy/change always use simple key retrieving |
| if ($this->add_operation() |
if ($this->add_operation() |
|
|
| } |
} |
| $fields[] = $this->fqn($k).' AS '.$this->sd.'qf'.$k.$this->ed; // no delimiters here, or maybe some yes |
$fields[] = $this->fqn($k).' AS '.$this->sd.'qf'.$k.$this->ed; // no delimiters here, or maybe some yes |
| if ($this->col_has_values($k)) { |
if ($this->col_has_values($k)) { |
| $fields[] = $this->fqn($k, true, true).' AS '.$this->sd.'qf'.$k.'_idx'.$this->ed; |
if($this->col_has_sql($k)) $fields[] = $this->fdd[$k]['sql'].' AS '.$this->sd.'qf'.$k.'_idx'.$this->ed; |
| |
else $fields[] = $this->fqn($k, true, true).' AS '.$this->sd.'qf'.$k.'_idx'.$this->ed; |
| } |
} |
| if ($this->col_has_datemask($k)) { |
if ($this->col_has_datemask($k)) { |
| $fields[] = 'UNIX_TIMESTAMP('.$this->fqn($k).') AS '.$this->sd.'qf'.$k.'_timestamp'.$this->ed; |
$fields[] = 'UNIX_TIMESTAMP('.$this->fqn($k).') AS '.$this->sd.'qf'.$k.'_timestamp'.$this->ed; |