quien me pueda ayudar mil gracias
soy muy novato en php
lo que quiero es guardar y cuando guarde que me compruebe si existe registo
Código PHP:
<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
<?php
include ('conexion.php');
include('../Javascript/Mensajes.php');
include('../Javascript/Control.php');
$TB_Ref = $_POST ['TB_Ref'];
$TB_Tall = $_POST ['TB_Tall'];
$TB_Mar = $_POST ['TB_Mar'];
$TB_Col = $_POST ['TB_Col'];
$TB_Emp = $_POST ['TB_Emp'];
$TB_Cdb = $_POST ['TB_Cdb'];
$TB_Cdc = $_POST ['TB_Cdc'];
$TB_Acr = $_POST ['TB_Acr'];
$TB_Pol = $_POST ['TB_Pol'];
$TB_Ela = $_POST ['TB_Ela'];
$TB_Alg = $_POST ['TB_Alg'];
$TB_Poli = $_POST ['TB_Poli'];
$TB_Cau = $_POST ['TB_Cau'];
$sql=mysql_query("Select * FROM codigos where referencia=$TB_Ref");
$datos=mysql_fetch_array($sql);
if(mysql_num_rows($datos)) {
echo "<script type=''>
alert ('La referencia ya Existe');
</script>";
}else{
echo "<script type=''>
alert ('Ha registrado Referencia satisfactoriamente');
</script>";
}
?>