查看文件: apisetkind.php
大小: 1.03 KB
类型: application/octet-stream
<?php require_once('../Connections/BEB2.php'); ?> <? $yy=isset($_POST['byy'])?$_POST['byy']:'1900'; $mm=isset($_POST['bmm'])?$_POST['bmm']:'01'; $dd=isset($_POST['bdd'])?$_POST['bdd']:'01'; $sex=isset($_POST['bsex'])?$_POST['bsex']:''; $birthdate=$yy.'-'.$mm.'-'.$dd; $from = new DateTime(date('Y-m-d')); $age = date_diff($from, date_create($birthdate))->y; //echo $age; // Output: 14 mysql_select_db($database_BEB2, $BEB2); $query_Rot2 = sprintf("SELECT * FROM dat3 where csex='%s' AND cmin<=%s AND cmax>=%s",$sex,$age,$age); $Rot2 = mysql_query($query_Rot2, $BEB2) or die(mysql_error()); $row_Rot2 = mysql_fetch_assoc($Rot2); $totalRows_Rot2 = mysql_num_rows($Rot2); // echo $query_Rot2; //insert into `dat3a` (csex,cname,cmin,cmax) select csex,cname,cmin,cmax FROM `dat3` where csex='女' order by csex,cmin //insert into `dat3a` (csex,cname,cmin,cmax) select concat('男'),cname,cmin,cmax FROM `dat3a` where csex='女' order by csex,cmin if($totalRows_Rot2>0) { echo $row_Rot2['cname']; } mysql_free_result($Rot2); ?>
保存
取消
返回文件列表