Strange fatal error in terminal

Hi group,

My program is

<?php
mysql_connect('ns1','tdphp8','tdphp8')or die('connection error');
print'hai';
?>
===========================================================
my output is

[tdphpadmin [at] conws60 ~/public_html/demo]$ php sql.php
PHP Fatal error: Call to undefined function mysql_connect() in /
home/
tdphpadmin/public_html/demo/sql.php on line 2
X-Powered-By: PHP/5.2.0
Content-type: text/html
===========================================================

In the web browser,Everything works good and
I am not getting the error or die message.
The string hai is displayed in the browser.
Actually database connection is established and data,insertion data
retrieval are successful
But i am receiving this error in terminal.

please help
geevaa [ Mi, 02 Mai 2007 16:02 ] [ ID #1702954 ]

Re: Strange fatal error in terminal

On May 2, 10:02 am, Geevaa <govivasa... [at] gmail.com> wrote:
> Hi group,
>
> My program is
>
> <?php
> mysql_connect('ns1','tdphp8','tdphp8')or die('connection error');
> print'hai';
> ?>
> ===========================================================
> my output is
>
> [tdphpadmin [at] conws60 ~/public_html/demo]$ php sql.php
> PHP Fatal error: Call to undefined function mysql_connect() in /
> home/
> tdphpadmin/public_html/demo/sql.php on line 2
> X-Powered-By: PHP/5.2.0
> Content-type: text/html
> ===========================================================
>
> In the web browser,Everything works good and
> I am not getting the error or die message.
> The string hai is displayed in the browser.
> Actually database connection is established and data,insertion data
> retrieval are successful
> But i am receiving this error in terminal.
>
> please help

Run php -i from the terminal and confirm the location of php.ini.
Make sure it's the same php.ini that's being used by the webserver.
zeldorblat [ Fr, 04 Mai 2007 17:48 ] [ ID #1704711 ]

Re: Strange fatal error in terminal

Usually that error occurs when mysql cannot be located by PHP either because
it was not compiled with MySQL, or because the extention wasn't loaded
properly.

You might want to put a phpinfo() file and see if you have MySQL enabled in
there.

Steve.

"Geevaa" <govivasanth [at] gmail.com> wrote in message
news:1178114572.016812.129290 [at] c35g2000hsg.googlegroups.com.. .
> Hi group,
>
> My program is
>
> <?php
> mysql_connect('ns1','tdphp8','tdphp8')or die('connection error');
> print'hai';
> ?>
> ===========================================================
> my output is
>
> [tdphpadmin [at] conws60 ~/public_html/demo]$ php sql.php
> PHP Fatal error: Call to undefined function mysql_connect() in /
> home/
> tdphpadmin/public_html/demo/sql.php on line 2
> X-Powered-By: PHP/5.2.0
> Content-type: text/html
> ===========================================================
>
> In the web browser,Everything works good and
> I am not getting the error or die message.
> The string hai is displayed in the browser.
> Actually database connection is established and data,insertion data
> retrieval are successful
> But i am receiving this error in terminal.
>
> please help
>
Steve Belanger [ Sa, 05 Mai 2007 05:11 ] [ ID #1705343 ]
PHP » alt.php.sql » Strange fatal error in terminal

Vorheriges Thema: While data geting from mysql error
Nächstes Thema: Retrieve image URL