Parse error: syntax error, unexpected T_STRING

I am trying to call a stored procedure  named spRunRefresh from php.  
The code is:
osql -E -d Iris -S Gamay-srv1 -Q "Exec spRunRefresh ;

I receive the following error:
Parse error: syntax error, unexpected T_STRING in C:\Inetpub\wwwroot\CallFile2.php on line 2

the code osql -E -d Iris -S Gamay-srv1 -Q "Exec spRunRefresh ;

works from a bat file.

Any ideas
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
osql is a command line tool, and not php syntax.

so, you want to run it with the system command?!
system 'osql -E -d Iris -S Gamay-srv1 -Q "Exec spRunRefresh;" ';

Open in new window

however, you normally would not do that from php ...
you would want to connect with either the mssql extension or with odbc, ado etc ...
mssql extensions:
using adodb:
aka: choose your poison
Lukasz ChmielewskiConnect With a Mentor Commented:

Just like angellll said - it is not the thing you want to do (not very safe)
Ray PaseurConnect With a Mentor Commented:
You can learn about PHP here:
ScamquistAuthor Commented:
This is used on an intra net with limited access.  

i tired
system 'osql -E -d Iris -S Gamay-srv1 -Q "Exec spRunRefresh;" ';
and received the error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Inetpub\wwwroot\CallFile2.php on line 2
ScamquistAuthor Commented:
Thank you all for you help.  I will study up and see what I can do.  I may try to do this through a batch file.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.