|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-02-13 18:02 UTC] kalle@php.net
 
-Status: Open
+Status: Bogus
  [2011-02-13 18:02 UTC] kalle@php.net
  [2011-02-14 01:21 UTC] lkzwieder at hotmail dot com
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
Description: ------------ If I change the current 'SELECT' to 'SELECT * FROM...' the script works fine. Otherwise PHP shows me the follow warning: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/distri/functions.php on line 158 Test script: --------------- function get_productos($link,$params = null){ $query = "SELECT p.id, p.codigo, p.nombre, f.nombre as familia, pro.nombre as provedor, p.precio, p.tamaño, p.medida FROM productos p INNER JOIN familias f ON p.familia = f.id INNER JOIN provedores pro ON p.provedor = pro.id"; $result = mysql_query($query, $link); $i = 0;$productos = array(); while($data = mysql_fetch_assoc($result)){ foreach($data as $key => $valor){ $productos[$i][$key] = $valor; } $i++; } mysql_close($link); return $productos; } Expected result: ---------------- I expect fill the array $prod with data. Actual result: -------------- Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/distri/functions.php on line 158