文章列表
 
您正在查看 "php+mysql" 分类下的文章

2010-06-17 9:38
 
2010-06-07 15:58
 
2010-06-02 22:02

 
2010-05-30 11:51
 
2010-05-23 12:32

在net.tutsplus.com看到篇文章觉得不错就记录下来,可以方便以后抓取网页内容然后进行过滤操作!

http://net.tutsplus.com/tutorials/php/html-parsing-and-screen-scraping-with-the-simple-html-dom-library/

  1. # get the first occurrence of id="foo"
 
2010-05-18 22:15
/**
* @param $url string | 要提交的URL地址
* @param $da
 
2010-05-18 16:57

<?php
@date_default_timezone_set('Asia/Chongqing');

$now_time = time();
$date=date("Y-m-d",$now_time);

function get_date($date,$t='d',$n=0)
{
if($t=='d'){
   $firstday = date('Y-m-d 00:00:00',strtotime("$n day"));
   $lastday = date("Y-m-d 23:59:59",strtotime("$n day"));

}elseif($t=='w'){
   if($n!=0){$date = date('Y-m-d',strtotime("$n week"));}

 
2010-05-05 9:45

如上图所示,是两段不重复的时间段,那么肯定会出现B-C之间的阴影部分,只有当阴影部分<=0的时候才不重复,利用向量的解决方法如下:
abs(C-A)+abs(D-B)<(B-A)+(D-C)

abs是取绝对值

则可以判断两段时间是否重复

 
2010-04-24 3:52

最近在处理一个程序中遇到一个小问题,当时觉得很奇怪,后来在同事的协助下找了一些资料发现原来是mysql_connect这个函数造成的

是这样的 在一个程序中 同时对多个数据库进行连接,程序实际设计多个数据库的意图是为了将数据库分离,减轻数据库服务器的压力,但是我在调试的过程中 都是在本地一个服务器中进行的 建立的了类似于如下的代码:

//前面定义dbhost dbuser dbpwd 等 变量
$conn1 = mysql_connect($dbhost,$dbuser,$dbpwd);
mysql_select_db(”database1″,$conn1);

$c

 
2010-03-24 12:43
<?php
function getArray1($thearray,$thecount){
        if ($thecount == 0 or $thecount == 1) return $thearray;
        if ($thecount == 2) return array($thearray[0].$thearray[1], $thearray[1].$thearray[0]);
        for ($i=0; $i<$thecount; $i++){
               $char = $thearray[$i];
 
   
 
 
文章分类
 
 
 
Asp(8)
 
 
 
 
 
Ajax(3)
 
Sql(2)
 
 
 
 
 
 
 
 
 
   
 
文章存档
 
     
 
最新文章评论
  

太好了,我的也出这个问题了
 

帮大忙了
 

$conn1 = mysql_connect(localhost,user,pwd,true); $select_db = mysql_select_db($
 

真没想到有这个啊
 

如果用户禁用了JS,那也就不必让他取数据了吧
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu