Viewing file: contar.php (767 B) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require('conexion3.php');
$today = getdate();
$month = $today['month'];
$montho = $today['mon'];
$mday = $today['mday'];
$year = $today['year'];
$today1 = $mday . "/" . $montho . "/" . $year;
//echo $today1;
$consul = "SELECT *
FROM esta where fecha='$today1' and codigo='$codigosec'";
$result = mysql_query($consul,$db);
$num_filas = mysql_num_rows($result);
if ($num_filas == 0) {
$query ="INSERT INTO esta VALUES('$codigosec','$today1','1')";
$result1 = mysql_query($query,$db);
}else{
$myrow = mysql_fetch_array($result);
$how = $myrow["numero"];
$how++;
$query ="UPDATE esta SET numero='$how' WHERE codigo='$codigosec' and fecha='$today1'";
$result = mysql_query($query,$db);
}
?>
|