0
I need to make a while
in the PHP:
while($lo = mysql_fetch_array($ro)) {
$id3 = $lo["id"];
$nome_menor = utf8_encode($lo["nome_menor"]);
This is ok! This shows the name of the companies listed on query down below:
$ro = mysql_query("select * from empresa order by nome_menor");
But now I need to make one if
within the while
I need the if
check in the checkbox table if the variable name of the while
I thought of something like this:
$rz = mysql_query("select * from mulempresa where (id_contrato = $id2) ");
$ck1 = mysql_fetch_array($rz,MYSQLI_ASSOC);
$checked = "";
if($ck1[$nome_menor] == 1)
$checked3 = "checked=checked";
But the following mistake is making:
"Notice: Undefined index"
How can I fix this?
better you post the entire code. Because the error might be somewhere else. Generally, this error is caused because you have not rescued a variable. That’s why she’s undefined.
– Andrei Coelho