I pasted your code into a file testinclude.php (changing only the server 
name), then wrote another file test.php:

<?

include('testinclude.php');

?>

It parses okay for me. How are you doing the include?

-Steve

On Friday, April 12, 2002, at 03:02  PM, Alex Francis wrote:

> I get a parse error on line 2. The code is as follows:
>
> <?
> $server = "mysql.xcalibre.co.uk";
> $user = "user";
> $passwd = "password";
> $dbname = "rschool";
> $tablename1 = "story";
> $tablename2 = "guestbook";
> $tablename3 = "drawing";
> $tablename4="notices";
> $link = mysql_connect ($server, $user, $passwd);
> ?>
>
> As I said, when I paste the code into each file I don't have a problem.
> --
> Alex Francis
> Cameron Design
> 35, Drumillan Hill
> Greenock PA16 0XD
>
> Tel 01475 798106
> [EMAIL PROTECTED]
> http://www.camerondesign.co.uk
>
> This message is sent in confidence for the addressee only. It may 
> contain
> legally privileged information.
> Unauthorised recipients are requested to preserve this confidentiality 
> and
> to advise the sender
> immediately of any error in transmission.
> Steve Cayford <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Just a guess: Are you doing the include from a function? If so, make
>> sure you explicitly mark your global vars. Otherwise, what's the error
>> message?
>>
>> -Steve
>>
>> On Friday, April 12, 2002, at 12:28  PM, Alex Francis wrote:
>>
>>> I have one site which I am having problems connecting to my database.
>>> If I
>>> create my connections in an "include" config file I get an error on 
>>> the
>>> server connection. When I cut and paste the code exactly as it is into
>>> each
>>> file I have no problems. I have a local server set up in my office
>>> which I
>>> use to test my databases and scripts and have a slightly different
>>> config
>>> file on that one. The include file works fine.
>>>
>>> I have various other sites using "include" config files and have had 
>>> no
>>> problems, but this one is a pain, I have to change each file when I
>>> move it
>>> mrom my test server to my hosting server.
>>>
>>> Any help would be appreciated.
>>>
>>> --
>>> Alex Francis
>>> Cameron Design
>>> 35, Drumillan Hill
>>> Greenock PA16 0XD
>>>
>>> Tel 01475 798106
>>> [EMAIL PROTECTED]
>>> http://www.camerondesign.co.uk
>>>
>>> This message is sent in confidence for the addressee only. It may
>>> contain
>>> legally privileged information.
>>> Unauthorised recipients are requested to preserve this confidentiality
>>> and
>>> to advise the sender
>>> immediately of any error in transmission.
>>>
>>>
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to