I am making a form for editing materials (products).
I'm viewing the bill of materials and I created on my form a button that passes my IdItem
.
I'm wrong:
Warning: sqlsrv_fetch_array () expects parameter 1 to be resource, boolean given in D: \ xampp5.6 \ htdocs \ sysriomed \ banco-material.php on line 27
functionbuscaMaterial($conn,$IdItem){$query="select m.id as IdMat, I.id as IdItem, M.nome, M.tipo, I.nSerie ,I.valorUnitario from medx.dbo.material as M, medx.dbo.itemMaterial as I on M.id=I.idMaterial where IdItem = {$IdItem}";
$resultado = sqlsrv_query($conn, $query);
return sqlsrv_fetch_array($resultado, SQLSRV_FETCH_ASSOC);
}
I'm working with SQL Server 2014 and PHP 5.6.
-
banco-material.php
is where my functions related to the materials are. -
material-altera-formulario
is the data edit form. -
lista-material.php
is my list of material.