SOLVED checkbox database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Plata
Forum Newbie
Posts: 9
Joined: Mon Jan 26, 2009 11:05 am
Location: France,Paris

SOLVED checkbox database

Post by Plata »

hi,

For this moment, i try to recover a value from a database MySQL to put it next to a checkbox ; Typically the checkbox space value of database.
But actually i don't arrive to display the value of the database :

Code: Select all

//l'utilisateur connecté accéde à la liste des thémes disponibles sur le site
$req_affichage_themes = "select titre from theme_langue where theme_langue.id_langue=".$_SESSION['id_langue']." ";
 
//execution
$res_req_affichage_themes = sql_requete($req_affichage_themes);
 
//traditional way of display in my application
echo($res_req_affichage_themes[0]['titre']);
 
for ($i = 1 ; $i = $nb_elmts_res_req_affichage_themes ; $i++)
{
    ?>  <!-- affichage à tester -->
      [b] [u] <input type="checkbox" name="theme" value="<?php echo($res_req_affichage_themes[1]['titre'])   ?>"<br>[/u][/b]
    <?php
}
 
 
 
Can anyone help me?

see u :)
Last edited by Plata on Mon Feb 16, 2009 4:35 am, edited 1 time in total.
Plata
Forum Newbie
Posts: 9
Joined: Mon Jan 26, 2009 11:05 am
Location: France,Paris

Re: checkbox database

Post by Plata »

in fact, i arrive to display the records one by one but not inside the loop for all the elements

Code: Select all

[b][i]for ($i = 0; $i <=  $nb_elmts_res_req_affichage_themes ; $i++)[/i][/b]
{
    ?>  <!-- affichage à tester -->
        <input type="checkbox" name="theme" value="theme_value"> <?php echo("hey !!!".[i][u]$res_req_affichage_themes[i]['titre'][/u]) [/i]?> <br>
    <?php
}
    ?>
can you advice me?

see u :)
Plata
Forum Newbie
Posts: 9
Joined: Mon Jan 26, 2009 11:05 am
Location: France,Paris

Re: checkbox database

Post by Plata »

ok i resolved the tricky thing
--- i forgot the $ at i---

Code: Select all

for ($i = 0;[u] $i <=  $nb_elmts_res_req_affichage_themes[/u] ; $i++)
{
    ?>  <!-- affichage à tester -->
        <input type="checkbox" name="theme" value="theme_value"> <?php echo($res_req_affichage_themes[[b][u]$i[/u][/b]]['titre']) ?> <br>
    <?php
}
    ?>

how do i put "resolved" in the forum?

Plata
Post Reply