I want to do this in php maybe I can not explain myself well so if you need to modify it do not worry I can do it quickly since I feel in my pc
I have a table with only 2 variables (ACTIVE) and (NOT ACTIVE)
$sql = mssql("select estado from table where item = 'pesado'");
$temp = mssql_fetch_array ($sql);
I need the type = 'radio' checked if it's active How can I do it from a select?
<td WIDTH = 100>
<input size='1' type ='radio' value='ACTIVO' name='estado'>SI
<input size='7' type ='radio' value='NO ACTIVO' name='estado'>NO
</td>
OK friends as you will see right away I saw 4 comments activate me to try and try this but it gives me error
will be more concrete:
<?php
include "../../includes/db_connect_mysql.php";
$sql = mysqli_query($conexion,"
SELECT
id,
nombre,
nombre_esp,
nombre_eng,
nombre_bra,
orden,
estado,
id_padre,
seccion
FROM sr_productos_categorias
WHERE orden > 0 and seccion = 'tienda' ORDER BY orden ASC
");
if (mysqli_num_rows($sql) > 0){
echo
"Item a Editar;
<table border=1 aling=left WIDTH= 580>
<tr>
<td WIDTH= 280><font color=#FF000> Categoria Nombre: </font></td>
<td WIDTH= 50><font color=#FF000> Orden: </font></td>
<td WIDTH= 100><font color=#FF000> Estado: </font></td>
<td WIDTH= 110><font color=#FF000> Sub-Categoria: </font></td>
</tr>
</table>
"; while ($temp[6] = mysqli_fetch_array($sql))
{
print
"<table border=1 aling=left WIDTH= 580>
<tr>
<td WIDTH = 280><input type ='radio' name='codigo' value='".$temp["codigo"]."'>".$temp["nombre_esp"]."</td>
<td WIDTH = 50><input size='1' type='text' placeholder = 'orden' name='orden' value='".$temp["orden"]."' /></td>
<td WIDTH = 100>
<input size='1' type ='radio'
";
<?php ($temp[6] === true ? echo 'checked' : null) ?>
print
"
value='ACTIVO' name='estado'>SI
<input
";
<?php ($temp === false ? echo 'checked' : null) ?>
print
"
size='7' type ='radio' value='NO ACTIVO' name='estado'>NO
</td>
<td WIDTH = 110><name='orden' /><a href='#'>Editar</a></td>
</tr>
</table>
";}
echo
"
"
;} else{
echo"No hay datos";}
?>
What do I have to correct?