<?php
ini_set('display_errors', 1);
error_reporting(E_ERROR);  

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$admin = $_SESSION["admin_" . $dbname];
$success = false;

$query = mysqli_query($conn, "SELECT  a.`code` as a_code, a.rate as a_rate, a.size as a_size, b.`code` as b_code, b.rate as b_rate,b.size as b_size
                              FROM apps2ai_msg_101_2526.`prodsize` a, apps2ai_msg_101_2627.`prodsize` b 
                              WHERE a.code=b.code and a.rate != b.rate  and a.size=b.size") or die(mysqli_error($conn));
$fetnum = mysqli_num_rows($query);
if ($fetnum > 0) {
    $ctr = 0;
    while ($row = mysqli_fetch_array($query)) {
    $ctr++;

        echo "$ctr  Code " . $row['a_code'] . "  " .  $row['a_size'] . "<br>";
    }
}
?>