Enregistrer une checkbox dans tables sql
Résolu
dadou9101
Messages postés
107
Date d'inscription
Statut
Membre
Dernière intervention
-
Rollin'babe !! -
Rollin'babe !! -
Bonjour,
J aimerais mettre ma checkbox dans mon code mais je n'y arrive pas sa me met une erreur
voici mon code
<?php
include('connexion.php');
//création de la requête SQL
$sql = "SELECT * FROM `operations` WHERE `id_ope`=1";
//exécution de la requête SQL
$requete = @mysql_query( $sql, $link ) or die( $sql . "<br>" . mysql_error() );
echo "<table width=100% border=2>";
echo "<tr>";
echo "<td width=20%><center>Numéro</center></td>";
echo "<td width=80%><center>Description</center></td>";
echo "</tr>";
while ($tab = mysql_fetch_array($requete))
{
echo "<tr>";
echo "<td width=20%>".$tab['id_ope']."</td>";
echo "<td width=80%><a href=\"operations/operation (1).php?nom=".$tab['description_ope']."\" target=\"_blank\">".$tab['description_ope']."</a></td>";
echo "</tr>";
}
?>
j'aimerais que la checkbox soit mis a cote de ma variable .$tab['description_ope'].
je voulais savoir aussi comment puis je proceder a un enregistrement de ma checkbox sur une table
jai beau cherche je narrive pas a trouver une solution a mon probleme
Pouvez vous maidez sil vous plait
J aimerais mettre ma checkbox dans mon code mais je n'y arrive pas sa me met une erreur
voici mon code
<?php
include('connexion.php');
//création de la requête SQL
$sql = "SELECT * FROM `operations` WHERE `id_ope`=1";
//exécution de la requête SQL
$requete = @mysql_query( $sql, $link ) or die( $sql . "<br>" . mysql_error() );
echo "<table width=100% border=2>";
echo "<tr>";
echo "<td width=20%><center>Numéro</center></td>";
echo "<td width=80%><center>Description</center></td>";
echo "</tr>";
while ($tab = mysql_fetch_array($requete))
{
echo "<tr>";
echo "<td width=20%>".$tab['id_ope']."</td>";
echo "<td width=80%><a href=\"operations/operation (1).php?nom=".$tab['description_ope']."\" target=\"_blank\">".$tab['description_ope']."</a></td>";
echo "</tr>";
}
?>
j'aimerais que la checkbox soit mis a cote de ma variable .$tab['description_ope'].
je voulais savoir aussi comment puis je proceder a un enregistrement de ma checkbox sur une table
jai beau cherche je narrive pas a trouver une solution a mon probleme
Pouvez vous maidez sil vous plait
A voir également:
- Enregistrer une checkbox dans tables sql
- Audacity enregistrer son pc - Guide
- Enregistrer une conversation - Guide
- Comment enregistrer une video youtube - Guide
- Tables des matières word - Guide
- Comment enregistrer une musique sur youtube en mp3 - Guide
4 réponses
Bonjour,
J'apprends tranquillement le PHP - je vais essayer de t'aider.
Cette solution simple fonctionnerait elle ?.
A++.
<?php
include('connexion.php');
//création de la requête SQL
$sql = "SELECT * FROM `operations` WHERE `id_ope`=1";
//exécution de la requête SQL
$requete = @mysql_query( $sql, $link ) or die( $sql . "<br>" . mysql_error() );
echo "<table width=100% border=2>";
echo "<tr>";
echo "<td width=20%><center>Numéro</center></td>";
echo "<td width=80%><center>Description</center></td>";
echo "</tr>";
while ($tab = mysql_fetch_array($requete))
{
echo "<tr>";
echo "<td width=20%>".$tab['id_ope']."</td>";
echo"<td><input type='checkbox' name='action[]' value='".$tab['description_ope']"'></td>";
echo "</tr>";
}
?>
J'apprends tranquillement le PHP - je vais essayer de t'aider.
Cette solution simple fonctionnerait elle ?.
A++.
<?php
include('connexion.php');
//création de la requête SQL
$sql = "SELECT * FROM `operations` WHERE `id_ope`=1";
//exécution de la requête SQL
$requete = @mysql_query( $sql, $link ) or die( $sql . "<br>" . mysql_error() );
echo "<table width=100% border=2>";
echo "<tr>";
echo "<td width=20%><center>Numéro</center></td>";
echo "<td width=80%><center>Description</center></td>";
echo "</tr>";
while ($tab = mysql_fetch_array($requete))
{
echo "<tr>";
echo "<td width=20%>".$tab['id_ope']."</td>";
echo"<td><input type='checkbox' name='action[]' value='".$tab['description_ope']"'></td>";
echo "</tr>";
}
?>
jai trouve
je te passe la solution ou cas ou sa tinteresse
<?php
include('connexion.php');
//création de la requête SQL
$sql = "SELECT * FROM `operations` WHERE `id_ope`=1";
//exécution de la requête SQL
$requete = @mysql_query( $sql, $link ) or die( $sql . "<br>" . mysql_error() );
echo "<table width=100% border=2>";
echo "<tr>";
echo "<td width=10%><center>N°</center></td>";
echo "<td width=80%><center>Description</center></td>";
echo "<td width=10%><center></center></td>";
echo "</tr>";
while ($tab = mysql_fetch_array($requete))
{
echo "<tr>";
echo "<td width=10%><center>".$tab['id_ope']."</center></td>";
echo "<td width=80%><a href=\"operations/operation (1).php?nom=".$tab['description_ope']."\" target=\"_blank\">". $tab['description_ope']."</a></td>";
echo "<td width=10%><center><input type=\"checkbox\" name=\"id_cont\" value=\"1\" /></center></td>";
echo "</tr>";
}
?>
je te passe la solution ou cas ou sa tinteresse
<?php
include('connexion.php');
//création de la requête SQL
$sql = "SELECT * FROM `operations` WHERE `id_ope`=1";
//exécution de la requête SQL
$requete = @mysql_query( $sql, $link ) or die( $sql . "<br>" . mysql_error() );
echo "<table width=100% border=2>";
echo "<tr>";
echo "<td width=10%><center>N°</center></td>";
echo "<td width=80%><center>Description</center></td>";
echo "<td width=10%><center></center></td>";
echo "</tr>";
while ($tab = mysql_fetch_array($requete))
{
echo "<tr>";
echo "<td width=10%><center>".$tab['id_ope']."</center></td>";
echo "<td width=80%><a href=\"operations/operation (1).php?nom=".$tab['description_ope']."\" target=\"_blank\">". $tab['description_ope']."</a></td>";
echo "<td width=10%><center><input type=\"checkbox\" name=\"id_cont\" value=\"1\" /></center></td>";
echo "</tr>";
}
?>
Re,
T'a l'air bon en PHP.
Si tu pouvais aider celui là - ca serait pas mal car il comprends mal ce que j'essaye de lui dire pour comprendre le problème.
A++.
T'a l'air bon en PHP.
Si tu pouvais aider celui là - ca serait pas mal car il comprends mal ce que j'essaye de lui dire pour comprendre le problème.
A++.
Oups,
http://www.commentcamarche.net/forum/affich 8710666 timestamp en format date sql php#2008 10 06%2023%3A53%3A02
... (il a pas bien l'aire de comprendre ce que lui raconte - merci).
http://www.commentcamarche.net/forum/affich 8710666 timestamp en format date sql php#2008 10 06%2023%3A53%3A02
... (il a pas bien l'aire de comprendre ce que lui raconte - merci).