gestion bibliotheque
gestion bibliotheque
<?php
mysql_connect('localhost','root','') or die('erreur de connexion');
mysql_select_db('bibliotheque')or die('base inexistante');
$c=$_POST['cin'];
$n=$_POST['nom'];
$p=$_POST['prn'];
$g=$_POST['genre'];
$req1="select * from abonne where cin='$c'";
$res1=mysql_query($req1);
$n1=mysql_num_rows($res1);
if ($n1!=0) {echo('abonné deja inscrit');}
else
{
$req2="insert into abonne values('$c','$n','$p','$g')";
$res2=mysql_query($req2);
$nn=mysql_affected_rows();
if ($nn!=0) {echo('abonné ajouté avec succès');}
}
?>
mysql_connect('localhost','root','') or die('erreur de connexion');
mysql_select_db('bibliotheque')or die('base inexistante');
$c=$_POST['cin'];
$n=$_POST['nom'];
$p=$_POST['prn'];
$g=$_POST['genre'];
$req1="select * from abonne where cin='$c'";
$res1=mysql_query($req1);
$n1=mysql_num_rows($res1);
if ($n1!=0) {echo('abonné deja inscrit');}
else
{
$req2="insert into abonne values('$c','$n','$p','$g')";
$res2=mysql_query($req2);
$nn=mysql_affected_rows();
if ($nn!=0) {echo('abonné ajouté avec succès');}
}
?>
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|