sp; $sp->setString($sqlstring); $vals=$sp->parseSqlQuery(); $table=$vals->table; $keys=$vals->colNames; $values=$vals->fieldValues; for($i=0;$idb_name.$table.'/schema.php')) { $thiz->ErrorMsg[0] = DB_ERRORMSG_102; $rs = false; } else { if (isset ($columns) && is_array ($columns)) { $thiz->columns = $columns; } if (isset ($nncolumns) && is_array ($nncolumns)) { $thiz->nncolumns = $nncolumns; } for ($i = 0; $i < count ($keys); $i++) { $tmp[$keys[$i]] = $values[$i]; } if (isset ($tmp['id']) && strlen ($tmp['id']) > 0) { $id = $tmp['id']; if(is_file($thiz->db_name.$table.$id)) { $thiz->ErrorMsg[] = DB_ERRORMSG_111; $rs = false; } } else if ($thiz->columns['id'] == 'c') { //include_once('select.php'); //_select($thiz, 'SELECT id FROM '.$table.' ORDER BY id DESC'); $dh=opendir($thiz->db_name.$table); $id = 0; while ( $name = readdir( $dh )) { if( $name=="." || $name==".." || $name=="schema.php" ) continue; $max=str_replace(".php","",$name); if(is_numeric($max) && $id<$max)$id=$max; } $thiz->rowset = false; $id++; $thiz->nid = $id; } else { $thiz->ErrorMsg[] = DB_ERRORMSG_104; $rs = false; } if ($rs) { include_once('write_table.php'); $rs = _write_table($thiz, $table, $id, $tmp); } } $thiz->rowset = false; if ($rs) { return true; } else { return false; } } ?>