MySQL Forums
Forum List  »  PHP

INNER JOIN MySQL
Posted by: Smorn activo
Date: July 23, 2018 02:47AM

I am the beginner of the PHP/MySQL developer. This is my codes

<?php
include('config.php');

/*
stock_table1 BARCODE,NAME

stock_table3 BILL_NO,BARCODE

*/

$sql = "select
stock_table3.BILL_NO,
stock_table3.BARCODE,
stock_table1.BARCODE,
stock_table1.NAME
from stock_table3
INNER JOIN stock_table1
ON stock_table3.BARCODE = stock_table1.BARCODE";

$dbquery = mysqli_query($connect,$sql);
while ($result = mysqli_fetch_array($dbquery, MYSQLI_ASSOC))
{
$BARCODE = $result["BARCODE"];
$NAME = $result["NAME"];
echo "$BARCODE $NAME <br />";
}
?>

<!----
#Engined by
Apache Web Server Version 2.4.25
PHP Script Language Version 5.6.30
MySQL Database Version 5.7.17

#display

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\....... line 24
[$result = mysqli_fetch_array($dbquery, MYSQLI_ASSOC)]

What is it wrong ?

Big Thank

---->

Options: ReplyQuote


Subject
Written By
Posted
INNER JOIN MySQL
July 23, 2018 02:47AM
July 23, 2018 12:50PM
July 25, 2018 12:44AM
July 25, 2018 07:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.