Note that there are some explanatory texts on larger screens.

plurals
  1. POHow I call a Stored Procedure in AdoDB & MySQL?
    primarykey
    data
    text
    <blockquote> <p><strong>MySQL Procedure</strong></p> </blockquote> <pre><code>DELIMITER $$ DROP procedure `verifica_nf` $$ CREATE PROCEDURE `verifica_nf` (IN _id_servidor_val BIGINT, IN _nr_periodo_val INT) BEGIN DECLARE nota INT; DECLARE falta INT; -- Declare variables used just for cursor and loop control DECLARE no_more_rows BOOLEAN; DECLARE loop_cntr INT DEFAULT 0; DECLARE num_rows INT DEFAULT 0; -- CURSOR-- DECLARE NF_CUR CURSOR FOR -- //////////////////////////////////////////////////////////////// -- -- // VERIFICA SE E PERIODO ATIVO // -- -- //////////////////////////////////////////////////////////////// -- SELECT DISTINCT a.nr_notafinal, cr.nr_faltas FROM pmc_servidor s INNER JOIN pat_avaliacao a ON s.id_servidor = a.id_servidor INNER JOIN pat_avaliacaoetapa ae ON a.id_avaliacao = ae.id_avaliacao INNER JOIN pat_cronograma cr ON s.id_servidor = cr.id_servidor AND cr.nr_periodo = a.nr_periodo WHERE s.id_servidor = _id_servidor_val AND a.nr_periodo = _nr_periodo_val; -- Declare 'handlers' for exceptions DECLARE CONTINUE HANDLER FOR NOT FOUND SET no_more_rows = TRUE; OPEN NF_CUR; the_loop: LOOP FETCH NF_CUR INTO nota, falta; IF no_more_rows THEN LEAVE the_loop; END IF; SELECT nota, falta; END LOOP the_loop; END; $$ </code></pre> <blockquote> <p><strong>PHP Script</strong> </p> </blockquote> <pre><code>&lt;?php require_once("inc/con.php"); $db = ADONewConnection('mysqli'); $db-&gt;debug=1; $db-&gt;PConnect("localhost","root","xxxxx","database"); $id = '1197614'; $period = 1; $stmt = "CALL verifica_nf('$id','$periodo')"; $rs = $db-&gt;Execute($stmt); echo $rs; ?&gt; </code></pre> <hr> <p>The PHP script returns <b>nota</b> and <b>falta</b> value of database variables, but returns too the name of database variables. Like this:</p> <p><strong>(mysqli): CALL verifica_nf('1197614','1')<br> nota,falta 10000,1</strong> </p> <p>How can I get the values in a PHP variable?</p>
    singulars
    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