Thread: parse error

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    12
    Rep Power
    0
    Is it possible to access MySQL server (shareware version 3.22.32 runs under Windows 95 with Winsock 2) from other server via php3 ?

    I try to access to MySQL database "test" via PHP script that runs on other server and all the time I get the message: Parse error: parse error in /www/myserver/test.php3 on line 2

    Here is above mentioned PHP script:
    <?php
    mysql_connect(IP address of PC with MySQL under Windows95,username,password);
    @mysql_select_db(test) or die( "Unable to select database");
    ?>

    I have no problem to access database "test" via telnet from other server. PHP script runs on other server perfectly if I try to access local MySQL database on it:
    <?php
    mysql_connect(localhost,username,password);
    @mysql_select_db(database name) or die( "Unable to select database");
    ?>

    Could somebody help?
    Thank you for your assistance.

    Roman Kostinski
    e-mail: roman@astelit.ru
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    38
    Rep Power
    15
    um, why do you have the "@" in front of mysql_select_db()? i dont think you need it..
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    12
    Rep Power
    0
    Thank you very much for your replay. I removed "@", but it doesn't work
    Roman Kostinski

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by enygma:
    um, why do you have the "@" in front of mysql_select_db()? i dont think you need it..[/quote]

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    FYI:

    @ is the error suppression operator. It turns off error reporting from built-in functions.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Netherlands
    Posts
    77
    Rep Power
    16
    Did you already try (with quotes) ?

    @mysql_select_db("test") or die( "Unable to select database");

    Peter
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    12
    Rep Power
    0
    Thanks a lot for your help.

    I tried all staytments with quotes and it works!!!

    <?php
    mysql_connect("IP address of PC with MySQL under Windows95","username","password");
    mysql_select_db("test") or die( "Unable to select database");
    ?>



    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by PAV:
    Did you already try (with quotes) ?

    @mysql_select_db("test") or die( "Unable to select database");

    Peter
    [/quote]

Similar Threads

  1. trying to understand a parse error
    By DKY in forum PHP Development
    Replies: 16
    Last Post: February 18th, 2004, 12:53 PM
  2. Codepupil
    By Adachic in forum C Programming
    Replies: 3
    Last Post: February 6th, 2004, 07:50 PM
  3. Replies: 4
    Last Post: January 28th, 2004, 09:29 AM
  4. Replies: 3
    Last Post: January 25th, 2004, 06:46 PM
  5. [php error] parse error | fatal error
    By xeoHosting in forum PHP Development
    Replies: 2
    Last Post: January 4th, 2004, 02:13 AM

IMN logo majestic logo threadwatch logo seochat tools logo