php
bindValue error: Notice: Array to string conversion in C:\xampp\htdocs\eindwerk6\classes\User.php on line 362
I have been busy with a follow function. However, "Notice: Array to string conversion in C:\xampp\htdocs\eindwerk6\classes\User.php" on line 364 keeps popping up. This is the relevant function in User.php: public function checkFollow($mainID, $guest){ $conn = db::getInstance(); $statement = $conn -> prepare("SELECT COUNT(*) FROM followOthers WHERE followerID=:followerID AND followingID=:followingID"); $statement -> bindValue(':followerID', $mainID); //this is line 364 $statement -> bindValue(':followingID', $guest); return $statement; } This is where I call to that function: $check = $user->checkFollow($currentUser, $guest); $countCheck = 0; foreach ($check as $c){ $countCheck = 0; } This is where it's supposed to be used: if($check->fetchColumn() == 1){ echo "<a class='btn btn-default' href='#'>Unfollow</a>"; }else{ echo "<a class='btn btn-default' href='#'>Follow</a>"; }
Related Links
How to parse raw E-Mail with Zend Framework 2?
jquery mobile navbar isn't going active
Saving Canvas image to mysql
Search form on same line as navigation (array) php
Why isn't this simple sign up page working?
php & cookies : last $articleid visited in an array
How to give duplication validation in PHP mysql?
MySQL query select DISTINCT but display all rows
jQuery,PHP-upload text file,doc/docx,ppt/pptx,pdf [closed]
Fill missing date and prices (such as weekend) in array
Fetch a POST request that a site is sending to itself?
How to extract conditional operators from the given string in php?
Posted Variable Not being Sent to Db - Codeigniter
Rewrite single page url in Wordpress with .htaccess
Cannot get autocomplete to work in CodeIgniter - thoughts?
PHP efficiency, to use loops or not? (improving an old project)