Re: [PHP] delete file contents before writing?

2002-06-03 Thread Tobyn Baugher

On Mon, 2002-06-03 at 11:37, Jas wrote:
> Not sure how I could do this as I could not find a functions on php.net to
> allow me to first delete the entire contents of a file "before" writting the
> changes supplied by a textarea.  Here is what I have thus far:

Just fopen a file with the 'w' mode when you want to clear/truncate it
before writing to it.

$file_open($file_name,'w');

... would probably do what you want.

Toby


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




Re: [PHP] Question regarding :: syntax

2002-06-03 Thread Tobyn Baugher

On Mon, 2002-06-03 at 12:06, Jared Boelens wrote:

> Is there not a way to refer directly to the parent properties?  Or do i have
> to setup a get function for every parent var that I want to access.

Tis my understanding that you cannot refer to class properties without
an instance of the class. If I were wrong it would make my life much
easier, but I don't believe I am.

Regards,

Toby



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




RE: [PHP] Question regarding :: syntax

2002-06-03 Thread Tobyn Baugher

On Mon, 2002-06-03 at 12:45, Jared Boelens wrote:
> So am i to understand that i will have to do it in this manner?

*SNIP*

No no no... B extends A, and you have an instance of B. Just do this:

class A
{
var $b;

*snip*
}

class B
{
function B($b)
{
$this->b = $b;
}
}

That will work fine.

Regards,

Toby


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




Re: [PHP] OT - php/mysql/cron

2002-06-03 Thread Tobyn Baugher

On Mon, 2002-06-03 at 13:18, Kelly Meeks wrote:
> Any way to use cron to automate the mysqldumping of databases on a nighly basis?
> 
> Any examples would be greatly appreciated.

This line's gonna wrap, but it all goes on the same line :P

0 0 * * * /usr/local/bin/mysqldump -u  --password=
 > 

Obviously replace , , , and 
with the values you want to use for each.

Of course, I would never recommend putting a "secure" password in a text
file like your crontab, so if you have admin rights on the server maybe
consider setting up a read-only account with no password, or maybe a
unique password that won't work on any other accounts.

Never hurts to be a little paranoid.

HTH,

Toby


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




RE: [PHP] Question regarding :: syntax

2002-06-03 Thread Tobyn Baugher

On Mon, 2002-06-03 at 13:42, Jared Boelens wrote:
> This may be a dumb question but, how can you be sure that the $this-> is
> referring to the parent classes' property and not the current class.  On
> that note, does it really matter of which one it refers?

B inherits $b from A. $this->b and "parent"->b are the exact same thing.
This is why there's no special syntax to access "parent"->b from PHP.

Toby


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