So I have this code:
foreach ($_SESSION['basket'] as $item) {
$ref = $_SESSION['basket'][$counter];
$result = pg_query ($conn, 'SELECT * from music WHERE ref='.$ref.' ORDER BY artist');
}
This will output the first row fine, however it outputs this Warning: pg_fetch_row() expects parameter 1 to be resource, boolean given if I try to retrieve more than one row. I don't understand how I'm giving a boolean to parameter 1, this is the code on line 46 where it is getting the error:
($row = pg_fetch_row($result))
Thanks in advance
pg_fetch_row?while ($row = pg_fetch_row($result)) {