Example #1
0
function edit_ally($allyID, $tag, $name, $banner, $runden)
{
    $sql = "UPDATE `" . DB_PREFIX . "ally` SET `tag` = '" . $tag . "', `name` = '" . $name . "' WHERE `allyID` = '" . $allyID . "'";
    $res = mysql_query($sql);
    mysqL_query("DELETE FROM `" . DB_PREFIX . "banner_of_ally` WHERE `allyID` = '" . $allyID . "'");
    $sql = "INSERT INTO `" . DB_PREFIX . "banner_of_ally` VALUES";
    foreach ($banner as $id) {
        $sql .= " ('" . $id . "', '" . $allyID . "'),";
    }
    $res = mysql_query(substr($sql, 0, -1));
    mysqL_query("DELETE FROM `" . DB_PREFIX . "teil_der_runde` WHERE `allyID` = '" . $allyID . "'");
    $sql = "INSERT INTO `" . DB_PREFIX . "teil_der_runde` VALUES";
    foreach ($runden as $id) {
        $sql .= " ('" . $allyID . "', '" . $id . "'),";
    }
    $res = mysql_query(substr($sql, 0, -1));
}
Example #2
0
<h1>Files</h1>

<p>In this section, you can manage the files that appear alongside posts and pages on your website.</p>

<?php 
$searchquery = "SELECT * FROM files ORDER BY id DESC";
$searchresult = mysqL_query($searchquery);
$num = mysql_num_rows($searchresult);
if ($num > 0) {
    echo "<p>There are " . $num . " files in the database.</p>";
    echo "<table>";
    echo "<tr>";
    echo "<td>Title</td>";
    echo "<td>Type</td>";
    echo "<td>Description</td>";
    echo "<td>URL</td>";
    echo "<td>Filesize</td>";
    echo "<td>Preview</td>";
    echo "<td>Attach</td>";
    echo "</tr>";
    while ($row = mysql_fetch_array($searchresult, MYSQL_ASSOC)) {
        echo "<tr>";
        echo "<td>" . $row['title'] . "</td>";
        echo "<td>" . $row['type'] . "</td>";
        echo "<td>" . $row['description'] . "</td>";
        echo "<td>" . $row['url'] . "</td>";
        echo "<td>" . $row['filesize'] . "</td>";
        echo "<td><a href=\"#\" onclick=\"window.open('" . $globalhome . $uploads . $row['url'] . "','_blank','toolbar=no,menubar=no,location=no,directories=0,status=0,scrollbars=0,resize=0');\">Preview</a></td>";
        echo "<td><a href=\"#\" onclick=\"window.open('attach.php','_blank', 'width=600,height=300, toolbar=no,menubar=no,location=no,directories=0,status=0,scrollbars=0,resize=0');\">Attach</a></td>";
        echo "</tr>";
    }