the following error is thrown:
Fatal error: Trying to clone an uncloneable object of class mysqli_result
when I’m trying to use clone directly for a mysql query result:
$result = mysqli_query($con, $query);
$resultsClone = clone $result;
is there a way to clone mysqli object?
Cloning an unclonable object is not possible, as the name suggests.
Just because to tell a little bit more: In this specific case a
mysqli-result is (more or less — I don’t know the exact details) a pointer to a result “somewhere else”. Cloning would mean, that two pointers referes to the same result “somewhere else”, what again will probably lead to severe side effects, because fetching results from one result will definitely affect the other one.