I'm having a hard time pushing a ton of data from SQL into an HTML table.
I have a chartbuilder.php
file which has this code in it:
$pieQueryCreates = "SELECT Count(Action) FROM dbo.File_System_Profiles WHERE Action like '%create%' AND (DATEDIFF(day,TimeOccurred,getdate()) between 0 and 30)";
$pieQueryResult = sqlsrv_query($conn, $sQuery);
if ($pieResultCreates === false) {
die(sqlsrv_errors(SQLSRV_ERR_ERRORS));
}
$pieQueryCreateCount = sqlsrv_fetch_array($pieQueryResult);
This is my HTML:
<?php require '/php/chartbuilder.php'; ?>
<?php echo $pieQueryCreateCount; ?>
And I get nothing from the echo. If I echo $pieQuerCreateCount[0]
I still get nothing from the echo. If I echo $pieQueryResult
I get a Resource ID #4
which isn't a surprise but leads me to believe the query is being completed. Copy/pasting my SELECT statement into SQL returns the count as expected in a single row/column with no name.
I just need to be able to access that one value and nothing I am doing seems to work, I've read through the documentation for sqlsrv_fetch_array
this multiple times and tried a variety of changes based on their examples to find no success.