Note that there are some explanatory texts on larger screens.

plurals
  1. POfor loop call procedure mysql_fetch_array() expects parameter 1 to be resource, boolean given in
    primarykey
    data
    text
    <p>Hey i'm trying to call a procedure in a for loop but keep stumbling at the same error i've tried several things but just can't find the problem. here's a piece of my code</p> <pre><code>php: for ($x=1; $x&lt;=16; $x++) { $rs = mysql_query("CALL sp_programma(".$x.")"); $tmp='row'.$x; $$tmp = mysql_fetch_array($rs); } ?&gt; &lt;body&gt; &lt;div id="schoten"&gt; &lt;div class="plaats"&gt;Schoten&lt;/div&gt; &lt;div class="dag"&gt;Maandag &lt;div class="les" id="S1"&gt;&lt;?php echo $row1['Uur']; echo '&lt;/br&gt;'; echo $row1['Omschrijving']; echo '&lt;/br&gt;'; echo $row1['Omschrijving_grpnaam'] ?&gt;&lt;/div&gt; &lt;div class="les" id="S2"&gt;&lt;?php echo $row2['Uur']; echo '&lt;/br&gt;'; echo $row2['Omschrijving']; echo '&lt;/br&gt;'; echo $row2['Omschrijving_grpnaam'] ?&gt;&lt;/div&gt; </code></pre> <p>and the stored procedure:</p> <pre><code>DROP PROCEDURE IF EXISTS circant.sp_programma; CREATE PROCEDURE circant.`sp_programma`(param_name int) BEGIN SELECT tbl_groepen.Omschrijving_grpnaam, tbl_lessoorten.Omschrijving, tbl_lessen.Uur FROM (circant.tbl_groepen tbl_groepen INNER JOIN circant.tbl_lessen tbl_lessen ON (tbl_groepen.ID = tbl_lessen.GroepID)) INNER JOIN circant.tbl_lessoorten tbl_lessoorten ON (tbl_lessoorten.ID = tbl_lessen.Les_soort_ID) where tbl_groepen.ID = param_name; END; </code></pre> <p>only the first works (row1) but then for row2 and so on i get the error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Circant_beter\Agenda.php on line 18</p> <p>does any body know what i'm doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload