Forum Moderators: coopster

Message Too Old, No Replies

working with HTTP but not with PHP CLI?

with mssql database

         

amiz

2:18 pm on Aug 6, 2006 (gmt 0)

10+ Year Member



I am using php 4.3.9 on linux,

(ps - when i do php -v it prints-
PHP 4.3.2 (cgi), Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies)

And I am having this problem.

I have a script that connect to a database (mssql) and performs several queries

The script works fine when being run from a browser

But doesn’t work when being run from the command line

To test this I used the following commands:

print "before ";

$ link = @mssql_connect("MY_DB", "sa", "" ) or die("Could not connect!");

print "after";

it did print the "before" but didn’t get to print the "after"

and it doesn’t execute the queries following these lines.

coopster

6:35 pm on Aug 6, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, amiz.

First, I'd say you are running 4.3.2, not 4.3.9 ;)

Second, I can't believe this even works in a browser right now, you should be getting a parse syntax error because of that gap between the dollar sign and your variable name. You need to get them together there:

print "before "; 
$link = @mssql_connect("MY_DB", "sa", "" ) or die("Could not connect!");
print "after";