Beispiel #1
0
     deletesmiley($option, $cid);
     break;
 case "newsmiley":
     newsmiley($option);
     break;
 case 'ranks':
     showRanks($option);
     break;
 case "uploadranks":
     uploadranks($option, $cid0);
     break;
 case "editRank":
     editRank($option, $cid0);
     break;
 case "saveRank":
     saveRank($option, $id);
     break;
 case "deleteRank":
     deleteRank($option, $cid);
     break;
 case "newRank":
     newRank($option);
     break;
 case "showtrashview":
     showtrashview($option);
     break;
 case "showsystemreport":
     showSystemReport($option);
     break;
 case "trashpurge":
     trashpurge($option, $cid);
function rest_put($id, $star, $post_id)
{
    include "./image_test/dbconfig.php";
    $debug_msg = "not work";
    $mysqli = new mysqli($dbhost, $dbusr, $dbpass, $dbname);
    if ($mysqli->connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    $create_table = "CREATE TABLE if not exists stars (\n\t\t\t\t\tid int auto_increment,\n\t\t\t\t\tuser_id varchar(30),\n\t\t\t\t\tstar int,\n\t\t\t\t\tpost_id int,\n\t\t\t\t\tpost_user_id varchar(30),\n\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t);";
    $mysqli->query($create_table);
    $query_update = sprintf("UPDATE stars\n\t\t\tSET star = '%s' WHERE id = '%s'", $star, $id);
    $mysqli->query($query_update);
    $ret_val = "fail";
    if ($mysqli->affected_rows == 0) {
    } else {
        $ret_val = "success";
    }
    $star_saving_info = array("ret" => $ret_val);
    $mysqli->close();
    saveRank($id, $post_id);
    return $star_saving_info;
    //$debug_msg;
}