Re: [PHP] MySql: Default values

2001-04-10 Thread Andrew Rush

on 4/10/01 7:23 PM, elias at [EMAIL PROTECTED] wrote:

> Can a default field value in MySql be a function?

no.

> Like default value of a date field should be the built-in function NOW()?

still, nope.

> anything like what i'm asking for?

ahhh- if you are looking for a way to automatically have a timestamp
inserted into a record, make a new field of type timestamp that is not null.
if you don't insert any value into the timestamp field it will use the
current date-time.



have a great day
andy

-- 
*******
Andrew Rush :: Lead Systems Developer :: MaineToday.com
***

"A friend of the devil is a friend of mine" - R. Hunter





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] BUG - Someone else please verify B4 I file

2001-04-04 Thread Andrew Rush

on 4/4/01 5:14 PM, Data Driven Design at [EMAIL PROTECTED] wrote:

> I've noticed that and had to rewrite several scripts when hosts upgraded
> from PHP3 to PHP4. $HTTP_POST_VARS is considered set even when it is empty.

i have also noticed this. we run 4.0.3pl1 here.


have a great day
andy

-- 
*******
Andrew Rush :: Lead Systems Developer :: MaineToday.com
***

"A friend of the devil is a friend of mine" - R. Hunter





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Case?

2001-03-29 Thread Andrew Rush

on 3/29/01 12:14 PM, [EMAIL PROTECTED] splat open and thusly melted:

> if so where I can
> find them detailed in the online docs?

look under switch, in control structures.

-- 
:: Andrew Rush :: Lead Systems Developer :: MaineToday.com ::
**
"Crippled but free, blind all the time, i was learning to see"
 
- J. Garcia / R. Hunter
**
 
The  views expressed herein are not necessarily those of my employer, but
they let me have them anyway.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL COUNT Won't Work

2001-02-16 Thread Andrew Rush


On Friday, February 16, 2001, at 09:27 AM, Jeff Oien wrote:

> $result = mysql_query($sql,$connection) 
>   or die("Couldn't execute query.");  //<$queryhttp://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] counting files

2001-02-16 Thread Andrew Rush


On Friday, February 16, 2001, at 10:31 AM, Hoover, Josh wrote:

> Try this bit of code and see if it works.  (I don't know if there's a less 
> taxing (on the server) way to get a count of files in a directory or not.) 

this code snippet won't work as a standalone. you are referencing an object that does 
not exist.

> $myDirectory = dir("yourdirectory"); 
> while($entry=$myDirectory->read())  
> { 
> $filecount++; 
> } 
> $myDirectory->close(); 
>  

you are on the right track though. if you are sure that everything in the directory 

$d=opendir("path/to/my/directory");

$i=0;

while($found=readdir($d)) {

if($found != "." && $found != "..") {

$i++;

}

}

print("there were $i files found.");


:: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: 
:** 
"Crippled 
:but free, blind all the time, i was learning to see" 
 
- J. Garcia / R. Hunter 
:** 
 
The  
:views expressed herein are not necessarily those of my employer, but  
they let me 
:have them anyway.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Regex Matching

2001-02-08 Thread Andrew Rush

in Perl, i do thusly:

$adtext = "This is a {test}  john.smith\@mail.mainetoday.com";
 
$email = $1 if($adtext=~/(\{.*\})/);
 
print "email = $email\n\n";

and i get back "email = "test".

i then do thusly in PHP:

$f=fopen($test_name, "r");
 
   
while(!feof($f)) {
 
   $line=fgets($f, 4096);
 
   preg_match_all("/(\{.*\})/", $line, $holes);
 
  
   }

after this $holes contains the number of elements i expect to get back, but has no 
values. any ideas what i am doing wrong?


:: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: 
:** 
"Crippled 
:but free, blind all the time, i was learning to see" 
 
- J. Garcia / R. Hunter 
:** 
 
The  
:views expressed herein are not necessarily those of my employer, but  
they let me 
:have them anyway.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]