33 lines
1.1 KiB
PHP
Executable File
33 lines
1.1 KiB
PHP
Executable File
<?php
|
|
$code=$_GET['code'];$quantite=$_GET['quantite'];
|
|
include("conf.php");
|
|
include("mysql_compat.php");
|
|
include ("conf.php");
|
|
$db_connection=mysql_connect($db_host,$db_user,$password);
|
|
mysql_select_db($db_name,$db_connection);
|
|
echo 'code: ',$code;echo 'quatite: ',$quantite;
|
|
$requete="INSERT INTO test(id_test,quantite,code) values ('','$code','$quantite');";
|
|
$reponse=mysql_query($requete,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$requete="SELECT quantite, code FROM test;";
|
|
$reponse=mysql_query($requete,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
echo"<table><FORM ACTION='test.php' METHOD=GET>";
|
|
while ($reptab=mysql_fetch_array($reponse)){
|
|
echo"<TR><td>$reptab[0]</td><td>$reptab[1]</td></TR>";
|
|
}
|
|
?>
|
|
<TR>
|
|
<td>
|
|
<INPUT TYPE=TEXT SIZE=20 NAME="quantite">
|
|
</td>
|
|
<td>
|
|
<INPUT TYPE=TEXT SIZE=20 NAME="code">
|
|
</td>
|
|
<TD ALIGN="CENTER">
|
|
<?php
|
|
echo "<A HREF='test.php?quantite=$quantite&code=12'><H0>ajouter</H0></A><input type = submit value='Validation'>";?>
|
|
</TD>
|
|
</TR>
|
|
</table>
|
|
</form>
|
|
<?php
|
|
?>
|