Currently having an issue with PDO im new to it also (which doesn't help)
this is the current segment of my code
> try{
$sql = $conn->prepare(" SELECT Channel_Location FROM channels)
ORDER BY RAND()
limit 5");
$sql->execute(array(':Location' => ''));
$row = $sql->fetch(PDO::FETCH_ASSOC);
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
I'm basically trying to connect to the database and pull 5 random results from the table Channel_Location
but i'm receiving a error Object of class PDOStatement could not be converted to string and i was wondering how i'd solve this by putting the 5 results it returns in to an array?