Re: How to run php function from command line?
| From: | Tyler Longren | Date: | Mon, 20 Aug 2001 14:09:23 +0000 |
| Subject: | Re: How to run php function from command line? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63508@lists.php.net to get a copy of this message | ||
First of all, you need to have php installed WITHOUT a webserver. If you
haven't done this already, download php, and this should be your
./configure command:
./configure --with-mysql
make; make install
your php binary will be in /usr/local/lib/php/bin/php (I think). Then put
this in test.php, and chmod +x it:
#!/usr/local/lib/php/bin/php
$connection = mysql_connect("localhost","user","pass");
$db = mysql_select_db("db_to_use", $connection);
$sql = mysql_query("UPDATE table SET name='name', email='email'");
Then do ./test.php from the command line.
--
Tyler Longren
Captain Jack Communications
tyler@captainjack.com
www.captainjack.com
On Mon, 20 Aug 2001 14:13:34 +0100
Moise Bertrand TACHAGO <mbtachago@sdnp.cm> wrote:
> Hi,
> please, how to run php function which update mysql db from command line?
>
> Thanks in advance
>
> --
> Moise Bertrand TACHAGO
> Computer scientist, Volunteer DBMS Specialist
> SDNP Cameroon, 506 Hajal Center Building, Yaounde CAMEROON
> phone (237)22 24 90
> E_mails mbtachago@sdnp.cm
> tachago_bertrand@yahoo.fr
>
>
>