btcq.net
当前位置:首页 >> php查询 >>

php查询

进入php源程序目录中的ext目录中,这里存放着各个扩展模块的源代码,选择你需要的模块,比如curl模块:cd curl 执行phpize生成编译文件,phpize在PHP安装目录的bin目录下 /usr/local/php5/bin/phpize 运行时,可能会报错:Cannot find

写个然后写个1.php页面在里面用$_POST['uid']接收到你提交的id的值,然后用这个值查询数据库就行了

1.php代码 a.php?t=1//a.php t是列表type$type =$_GET['t'];if($type==='1'){ $where_sql = "where lxtc like '乐享%'"; }else if($type==='2'){ $where_sql = "where lxtc like '新融合%'"; }elseif($type==='3'){ $where_sql = "where lxtc like '新融合%'

1. 连接数据库2. 代码如下 mysql_select_db("DB",$conn); if (isset($_POST['submit'])){ $num=$_POST['num']; $sql="SELECT num FROM TEST WHERE num=$num"; $tt=mysql_query($sql,$conn); $row = mysql_fetch_assoc($tt); echo "num:".$row['num'].""; }?>

一般替换就是用str_replace啊,直接就可以用数组的.比如:$str=“qwdkjlkjasdioqwelkjwe”;$a = array('aa','bb','cc','dd');$b = array('**', '**','**','**');$str = str_replace($a, $b, $str);

<form action="" method="post">名字:<input type="text" name="text"/> <input type="submit" name="submit" value="查询"/> <form> <hr><?php $conn = mysql_connect(localhost,root,123456)or die('没有连接');$db = mysql_

具体代码如下:$timeout = 5; curl_setopt ($ch, CURLOPT_URL, ''); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); echo $file_

[code]select * from 表名 where `字段名` between '2010-02-05 15:06:59' and '2010-02-25 16:10:02'[/code]

查询,1、链接数据库2、查询读取数据库,3、输出数据库内容

$sql="SELECT id,news FROM ". DB_PREFIX . "app_list";后面加个var_dump($sql);exit;看看sql语句错了没

网站首页 | 网站地图
All rights reserved Powered by www.btcq.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com