Skip to content
Advertisement

Tag: sql

I am getting Warning:count():Parameter error

I am getting this error below in my vehicles-update.php and I have also attached my vehicle/index.PHP code. It appears before my header on my phpmotors/index.php page. Warning: count(): Parameter must be an array or an object that implements Countable in C:xammp_124htdocsphpmotorsvehiclesindex.php on line 142 Error shown: if(count($invInfo)<1){ Answer Take a look at your function getInvItemInfo. What does that function return

Query returns old data

I have a mysql query that counts how many orders have been made on my website: SELECT COUNT(`orderid`) FROM `orders` WHERE `completed` = 1 It works fine, but only when you refresh the page. If …

Yii2, how to add a LIMIT on a leftjoin to get only 1 result back

I am trying to get all records from the product table, these records are unique but i use a leftjoin to add a second table with images of these products but when I do it will return some products more than once as some products have 1 or more images. How can I use a limit on the product_images table

Advertisement