[go: up one dir, main page]

Menu

[r5]: / trunk / update.php  Maximize  Restore  History

Download this file

25 lines (24 with data), 758 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
include("functions.php");
$link = mysql_connect("$mysqlhost", "$mysqluser", "$mysqlpass")
or die('Could not connect: ' . mysql_error());
mysql_select_db("$mysqldb") or die('Could not select database');
//$result = mysql_query($query) or die('Query failed: ' . mysql_error());
if (isset($_POST['id'])) {
$animeid = $_POST['id'];
$animestatus = $_POST['status'];
switch ($_POST['action']) {
case "ustatus":
$sql = "UPDATE `animelist` SET `status` = '$animestatus' WHERE `id` = $animeid LIMIT 1;";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
echo "Success!";
break;
case "uencoder":
echo "encoder";
break;
}
mysql_close($link);
} else {
mysql_close($link);
die("blaargh some error occured"); }
?>