So, I have written some query code returns the error:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given
I understand that this is caused to a boolean response from the query, and I have checked it out, and the Boolean returned is equal to true. So I don't see why there is no response with a data array instead... Here's my code:
$data = mysqli_multi_query($connection, 'UPDATE teams SET teams.teamViews = teams.TeamViews
+ 1 WHERE (teams.teamID, \''.$userToken.'\') NOT IN (SELECT teams_views.teamId,
teams_views.'.$viewType.' FROM teams_views) AND teams.teamUrl = \''.TEAM_URL.'\';
INSERT INTO teams_views (teamId, '.$viewType.') SELECT t.teamId, \''.$userToken.'\'
FROM teams t WHERE t.teamUrl = \''.TEAM_URL.'\' AND NOT EXISTS (SELECT \''.$userToken.'\'
FROM teams_views WHERE t.teamId = teamId);
SELECT * FROM teams WHERE teams.teamUrl = \''.TEAM_URL.'\';');
$dataRow = mysqli_fetch_array($data, MYSQLI_ASSOC);
There are three queries in the SQL - An update, insert, and selection.
How could I alter my query or PHP to return data, rather than a boolean? Thanks