Remove duplicate column name in SQL query

This commit is contained in:
Thomas Nilsen 2018-11-21 11:24:39 +01:00
parent e41b45e067
commit 42815bacd6

View File

@ -123,7 +123,7 @@ class Constellation
$operator = ($future)?">=":"<="; $operator = ($future)?">=":"<=";
$limit++; $limit++;
$sql = $mysqli->prepare("SELECT users.id, status.type, status.title, status.text, status.time, status.end_time, users.username, status.id, status.id as status_id FROM status INNER JOIN users ON user_id=users.id WHERE `time` $operator ? AND `end_time` $operator ? OR (`time`<=? AND `end_time` $operator ? ) ORDER BY `time` DESC LIMIT ? OFFSET ?"); $sql = $mysqli->prepare("SELECT users.id, status.type, status.title, status.text, status.time, status.end_time, users.username, status.id as status_id FROM status INNER JOIN users ON user_id=users.id WHERE `time` $operator ? AND `end_time` $operator ? OR (`time`<=? AND `end_time` $operator ? ) ORDER BY `time` DESC LIMIT ? OFFSET ?");
$sql->bind_param("iiiiii",$timestamp, $timestamp, $timestamp, $timestamp, $limit, $offset); $sql->bind_param("iiiiii",$timestamp, $timestamp, $timestamp, $timestamp, $limit, $offset);
$sql->execute(); $sql->execute();
$query = $sql->get_result(); $query = $sql->get_result();