使用prepare语句重置自动增量

I have some problem when using prepare statement because I never use it before.Bellow is my code

$maxid = $rowid['product_id'];
$reset = "ALTER TABLE streamyxup AUTO_INCREMENT = $maxid";
$stmt = $conn->PREPARE($reset);
$query->EXECUTE;
DEALLOCATE PREPARE stmt;

You need to change your code as below to use mysql prepared statement

$maxid = $rowid['product_id'];
$reset = "ALTER TABLE streamyxup AUTO_INCREMENT = ?";
$stmt = $conn->prepare($reset);
$stmt->bind_param("i", $maxid);
$stmt->execute();

EDIT

You are mixing object oriented and procedural way of mysql. change your connection code as below

session_start();
$conn = new mysqli("103.6.xxx.xxx", "Miow", "xxow2!", "pe_tm");

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
SELECT MAX(autoincrement_field) + 1 FROM streamyxup INTO @maxautoinc;
ALTER TABLE streamyxup AUTO_INCREMENT = @maxautoinc;

AND

  SELECT @max := MAX(ID)+ 1 FROM streamyxup; 

  PREPARE stmt FROM 'ALTER streamyxup ABC AUTO_INCREMENT = ?';
  EXECUTE stmt USING @max;

  DEALLOCATE PREPARE stmt;