EDIT! Solved with:
$res=$conn->query("select Total from closingcount where Date='$currentDate'");
list($Total)= $res->fetch_row();
echo "Total=$Total.\n";
$conn->close();
I've successfully set up two html to php pages that popluate data for the same primary key. I've been trying to select one value from the record but keep running into issues. The following is as far as I've gotten. I was getting errors saying "no database selected" before adding the database name and a . before the table name. Now I'm getting this:
Sorry there is no valueSELECT command denied to user ''@'localhost' for table 'closingcount'
I've tried just about everything I've found online for selecting a single value.
<?php
$currentDate = date('Y-m-d');
echo "$currentDate";
echo "<br><br>";
echo "<br><br>";
require_once 'loginhydepark.php';
$conn = new mysqli($hn, $un, $pw, $db);
if ($conn->connect_error) die($conn->connect_error);
$query= "SELECT Total FROM hydeparkclosing.closingcount WHERE Date=$currentDate";
$query_result=mysql_query($query) or die("Sorry there is no value" .mysql_error());
while($row=mysql_fetch_object($query_result)){
echo $row->Total;
}
?>