//It doesnt load the database, especially it tells me that the functions mysqli_fetch_array() and mysqli_free_result() are expecting parameter 1 to be mysqli_result(they are warnings)
<?php
$servername = "smth.gr";
$username = "smth";
$password = "smth123";
// Create connection
$con = new mysqli($servername, $username, $password);
// Check connection
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
?>
<?php
$today=date("Y-m-d");
//query
$sql = "
SELECT FLINES.FLINES,LMAST.NAME,FDOC.FDOC,FLINES.COMMENTS AS FLCOMMENTS,FLINES.QTY1,SUBSTRING(FDOC.TRNDATE,1,10) AS TRNDATE,FLINES.SE1_START,TIMESTAMPDIFF(MINUTE,SE1_START,SE1_END) AS DIFERENCE
FROM FLINES
INNER JOIN FDOC ON FDOC.FDOC=FLINES.FDOC
INNER JOIN LMAST ON LMAST.LMAST=FDOC.LMAST
INNER JOIN SMAST ON SMAST.SMAST=FLINES.SMAST
WHERE TRNDATE >= '$today' AND SMAST.U_SE1='true' AND FLINES.SE1_END IS NULL
ORDER BY TRNDATE,FDOC,FLINES
";
//result
$result=mysqli_query($con,$sql);
//i will fix it with html and css
while($row = mysqli_fetch_array($result)) {
if ($temp_FDOC!=$row[FDOC]){
echo $row[NAME];
//echo'<br>';
$j=0; }
echo $j=$j+1;
echo $row[FLCOMMENTS];
echo $row[QTY1];
if($row[SE1_START]==NULL) {
echo '<button name="flines_id_start" value="<? echo $row[FLINES];?>" type="submit">ΞΕΚΙΝΑΩ</button>';
//echo'<br>';
}
else {
echo '<button name="flines_id_end" value="<? echo $row[FLINES];?>" type="submit">ΕΤΟΙΜΟ</button>';
echo '<button name="flines_id_again" value="<? echo $row[FLINES];?>" type="submit">ΕΠΑΝΕΚΚΗΝΙΣΗ</button>';
//echo'<br>';
}
$temp_FDOC=$row[FDOC];
};
mysqli_free_result($con);
?>