function untag_books(&$aliases, &$tags) { if (!count($tags) || !count($aliases)) { return 0; } $result = mysql_query("SELECT id " . "FROM tag " . "WHERE tag in (" . mysql_escape_array($tags) . ")") or die(__FILE__ . ':' . __LINE__ . ':' . mysql_error()); $tag_ids = mysql_fetch_fields($result); if (!count($tag_ids)) { return 0; } $result = mysql_query("SELECT id " . "FROM alias " . "WHERE alias in (" . mysql_escape_array($aliases) . ")") or die(__FILE__ . ':' . __LINE__ . ':' . mysql_error()); $alias_ids = mysql_fetch_fields($result); if (!count($alias_ids)) { return 0; } mysql_query("DELETE " . "FROM alias_tag " . "WHERE " . "tag_id IN (" . mysql_escape_array($tag_ids) . ") AND " . "alias_id IN (" . mysql_escape_array($alias_ids) . ")") or die(__FILE__ . ':' . __LINE__ . ':' . mysql_error()); return mysql_affected_rows(); }
function enumerate_items() { $result = mysql_query("\n\t\t\tSELECT no\n\t\t\tFROM page \n\t\t\tWHERE book_id = {$this->book_id}\n\t\t") or die(__FILE__ . ':' . __LINE__ . ':' . mysql_error() . "\n"); return mysql_fetch_fields($result); }
} if ($field->auto_increment) { $field->definition .= ' AUTO_INCREMENT'; } if ($key = mysql_result($describe, $i, 'Key')) { if ($field->primary_key) { $field->definition .= ' PRIMARY KEY'; } else { $field->definition .= ' UNIQUE KEY'; } } // Create the field length $field->len = mysql_field_len($result, $i); // Store the field into the output $output[$field->name] = $field; } return $output; } // Show echo "<form action='mdelcl.php?k={$k}&tb={$tb}' method='post' align='left'>"; $fields = mysql_fetch_fields("{$tb}"); foreach ($fields as $key => $field) { echo "»<input type='checkbox' name='i[]' value='{$field->name}'> <a href='col.php?k={$k}&tb={$tb}&cl={$field->name}'>" . htmlspecialchars($field->name) . "</a> "; echo htmlspecialchars($field->definition) . " <br/>"; } echo "<input type='submit' value='" . $lang["DELETE_SELECTED"] . "'></form>- - - <br/>\r\n<a href='addcol.php?k={$k}&tb={$tb}'>" . $lang["add_column"] . "</a> |\r\n<a href='copyt.php?k={$k}&tb={$tb}'>" . $lang["copy_table"] . "</a> |\r\n<a href='rename.php?k={$k}&tb={$tb}'>" . $lang["rename_table"] . "</a>"; } else { printf($lang["table_not_exists"], $tb); } echo "</div>"; include 'foot.php';