It's me again, hello. So I figured out my first problem, sorry for posting too much but I need a lil' help with this one. I keep having these errors:
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\wamp64\www\inventory\inventory\tableedit.php on lines 167, 169, 252, 253,284, 285 etc
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\wamp64\www\inventory\inventory\tableedit.php on lines 167, 169, 252, 253,284, 285 etc
Notice: Undefined index: from in C:\wamp64\www\inventory\inventory\tableedit.php on lines 282, 283 etc
To be honest, I think this whole page is a mess, I'm not really sure why but it seems like it works with the older version Mysql but since I got the deprecated errors, I changed everything to Mysqli but now I got these errors.
1.
< ? php
$da=date("Y-m-d");
$sql=mysqli_query("SELECT * FROM inventory");
$i=1;
while($row=mysqli_fetch_array($sql))
{
$id=$row['id'];
$date=$row['date'];
$item=$row['item'];
$qtyleft=$row['qtyleft'];
$qty_sold=$row['qty_sold'];
$price=$row['price'];
$sales=$row['sales'];
if($i%2)
{
? >
2.
$result1 = mysqli_query("SELECT sum(sales) FROM sales where date='$da'");
while($row = mysqli_fetch_array($result1))
3.
<?php
$a=$_POST['from'];
$b=$_POST['to'];
$result1 = mysqli_query("SELECT sum(sales) FROM sales where date BETWEEN '$a' AND '$b'");
while($row = mysqli_fetch_array($result1))
{
$rrr=$row['sum(sales)'];
echo formatMoney($rrr, true);
}
?>
I do really appreciate any answers, suggestions or opinions. Thank you so much for your time! Peace out.
PS: Please don't mark this as duplicate, the problems are different.