below is a handy function i inherited that (in the old mysql) allowed a single rowXcolumn (scalar) value to be returned
by using a one-line function call (instead of $results = and then $row['fieldname'] = the value you want)
with mysqli it is returning the error shown at the bottom.
any help with what was not updated properly for mysqli conventions?
$NumLineItems = db_sql("SELECT COUNT(*) FROM tblSales_order_details WHERE so_header_key = 30 ");
function db_sfq ($query)
$result = db_sql($query); // this function works fine
$row = mysqli_fetch_array($result);
return $row; // only one field scalar was requested
}// end db_SingleFieldQuery
Catchable fatal error: Object of class mysqli_result could not be converted to string
That error message often indicates an error in the previous statement. If everything is ok, your code should work. Look at Example #2 on this page: http://php.net/manual/en/mysqli-result.fetch-array.php
Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption. Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html). It addresses one of the most common problems that plague beginning PHP develop…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …