[PHP-DB] #@__ appeared in the sql statements

2011-09-12 Thread who.cat
Studying a cms recently ,got a sql statement like this :
  Select * From `#@__homepageset`
i knew the '#@__' means the table prefix but how it like this ?
Did defined in the mysql  or in the php code .i could't find its definition
at present.Any phper's comments thanks in advance .

All you best

What we are struggling for ?
The life or the life ?


Re: [PHP-DB] CURDATE()

2011-08-19 Thread who.cat
I tried on my db
select count(*) from my_table where col_timestampcurdate();
the column col_timestamp type is timestamp,this sql works well.
hope it helpful.

All you best

What we are struggling for ?
The life or the life ?



On Thu, Aug 18, 2011 at 5:21 PM, Geoff Lane ge...@gjctech.co.uk wrote:

 On Thursday, August 18, 2011, Ron Piggott wrote;

  What I tried below doesn t work:  ( CURDATE() . % )

 Even though date values are presented like strings, they are
 dates/times. So you need to either cast CURDATE() to a string or else
 perform 'date arithmetic'. Check the manual for DATEDIFF(), CAST(),
 and CONVERT().

  NOT LIKE  ( CURDATE() . % )

 I suspect that PHP's concatenation operator (the period) isn't
 recognised by MySQL (assuming that's the DB you're using). So you need
 to either use MySQL's CONCAT() function or else create the search
 string in PHP rather than MySQL. However, if you're going to do this,
 you need to also cast last_record_update to a string.

 Personally, I'd use:
   WHERE DATEDIFF(CURDATE(), last_record_update)  1
 (testing for 1 rather than 0 just in case the date rolled over between
 the update and the 'stale record' check.)

 HTH,

 --
 Geoff


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] how does this regular expression works

2011-07-13 Thread who.cat
Reading some code from the web spider,got the such a expression :
preg_match(@head[^]*(.*?)\/head@si,$file, $regs);
It's about get the head content of a website,i wanna know the match detail
.Could someone give some tips ,
thanks in advance .

All you best

What we are struggling for ?
The life or the life ?