Probleme update php/sql
canardwifi
-
canardwifi -
canardwifi -
Bonjour,
J ai un souci mon update ne fonctionne pas et je ne comprend pas pourquoi
$sql = "SELECT dvd, zone, format FROM general order by dvd";
$req = mysql_query($sql) or die( mysql_error() ) ;
$total = mysql_num_rows($req);
{
echo '<form method="post" action="test.php">';
echo '<table>'."\n";
echo '<tr>';
echo '<th ><b><u>DVD.</u></b></th>';
echo '<th ><b><u>ZONE</u></b></th>';
echo '<th><b><u>FORMAT</u></b></th>';
echo '</tr>'."\n";
while($row = mysql_fetch_array($req))
{
echo '<tr>';
echo '<td>'.$row["DVD"].'</td>';
echo '<td><input type="text" name="ZONE" value="'.$row["ZONE"].'"/></td>';
echo '<td><input type="text" name="format" value="'.$row["format"].'"/></td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
echo '<input type="hidden" name="dvd2" value='.$_POST['dvd'].' /><br><center><input type="submit" name="ok" value="Modifier"/></center>';
echo '</form>';
}
if (isset($_POST['ok']))
{
$sql2= "UPDATE general SET zone='".$_POST['zone']."', format='".$_POST['format']."'
WHERE dvd='".$_POST['dvd2']."'";
$req2= mysql_query($sql2) or die('Erreur SQL !'.$sql2.'<br>'.mysql_error());
if(isset($req2))
{
echo "Modification OK" ;
}
}
?>
Merci de votre aide
J ai un souci mon update ne fonctionne pas et je ne comprend pas pourquoi
$sql = "SELECT dvd, zone, format FROM general order by dvd";
$req = mysql_query($sql) or die( mysql_error() ) ;
$total = mysql_num_rows($req);
{
echo '<form method="post" action="test.php">';
echo '<table>'."\n";
echo '<tr>';
echo '<th ><b><u>DVD.</u></b></th>';
echo '<th ><b><u>ZONE</u></b></th>';
echo '<th><b><u>FORMAT</u></b></th>';
echo '</tr>'."\n";
while($row = mysql_fetch_array($req))
{
echo '<tr>';
echo '<td>'.$row["DVD"].'</td>';
echo '<td><input type="text" name="ZONE" value="'.$row["ZONE"].'"/></td>';
echo '<td><input type="text" name="format" value="'.$row["format"].'"/></td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
echo '<input type="hidden" name="dvd2" value='.$_POST['dvd'].' /><br><center><input type="submit" name="ok" value="Modifier"/></center>';
echo '</form>';
}
if (isset($_POST['ok']))
{
$sql2= "UPDATE general SET zone='".$_POST['zone']."', format='".$_POST['format']."'
WHERE dvd='".$_POST['dvd2']."'";
$req2= mysql_query($sql2) or die('Erreur SQL !'.$sql2.'<br>'.mysql_error());
if(isset($req2))
{
echo "Modification OK" ;
}
}
?>
Merci de votre aide
A voir également:
- Probleme update php/sql
- Windows update bloqué - Guide
- Winget update - Guide
- Asus live update - Télécharger - Utilitaires
- Easy php - Télécharger - Divers Web & Internet
- Wsus offline update - Télécharger - Systèmes d'exploitation