<?php
ini_set("display_error",1);
// error_log("auto");
error_reporting(E_ALL);
$dabas = mysqli_connect("localhost","root","","dbname");
if($dabas == false)
{
die("Error: Could Not Connect." .mysqli_connect_error());
}
$sql = "SELECT cpe.sku AS Sku, cpev.value AS NAME, cssi.qty AS Qty, cssi.stock_status AS STATUS
FROM cataloginventory_stock_status_idx cssi
JOIN catalog_product_entity_varchar cpev ON cssi.product_id = cpev.entity_id
JOIN catalog_product_entity cpe ON cssi.product_id = cpe.entity_id
WHERE cpev.attribute_id = 98 AND cpev.store_id = 4 limit 10 ";
if($res = mysqli_query($dabas, $sql)){
if(mysqli_num_rows($res) > 0){
echo "<table>";
echo "<tr>";
echo "<th>Sku :</th>";
echo "<th>Name : </th>";
echo "<th>Qty : </th>";
echo "<th>Stock Status : </th>";
echo "</tr>";
while($row = mysqli_fetch_array($res)){
echo "<tr>";
echo "<td>".$row['Sku']."</td>";
echo "<td>".$row['NAME']."</td>";
echo "<td>".$row['Qty']."</td>";
echo "<td>".$row['STATUS']."</td>";
}
echo "</table>";
mysqli_free_res($res);
}
else {
echo "No Matching Record are Found";
}
}
else {
echo "Error : Could not be able to excute $sqlgta. " .mysqli_error($dabas);
}
mysql_close($dabas);
?>
ini_set("display_error",1);
// error_log("auto");
error_reporting(E_ALL);
$dabas = mysqli_connect("localhost","root","","dbname");
if($dabas == false)
{
die("Error: Could Not Connect." .mysqli_connect_error());
}
$sql = "SELECT cpe.sku AS Sku, cpev.value AS NAME, cssi.qty AS Qty, cssi.stock_status AS STATUS
FROM cataloginventory_stock_status_idx cssi
JOIN catalog_product_entity_varchar cpev ON cssi.product_id = cpev.entity_id
JOIN catalog_product_entity cpe ON cssi.product_id = cpe.entity_id
WHERE cpev.attribute_id = 98 AND cpev.store_id = 4 limit 10 ";
if($res = mysqli_query($dabas, $sql)){
if(mysqli_num_rows($res) > 0){
echo "<table>";
echo "<tr>";
echo "<th>Sku :</th>";
echo "<th>Name : </th>";
echo "<th>Qty : </th>";
echo "<th>Stock Status : </th>";
echo "</tr>";
while($row = mysqli_fetch_array($res)){
echo "<tr>";
echo "<td>".$row['Sku']."</td>";
echo "<td>".$row['NAME']."</td>";
echo "<td>".$row['Qty']."</td>";
echo "<td>".$row['STATUS']."</td>";
}
echo "</table>";
mysqli_free_res($res);
}
else {
echo "No Matching Record are Found";
}
}
else {
echo "Error : Could not be able to excute $sqlgta. " .mysqli_error($dabas);
}
mysql_close($dabas);
?>
No comments:
Post a Comment