problem connecting to mySQL

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Re: problem connecting to mySQL


    On 6-Jul-2003, "GazK" <wrong@wrong.co.uk> wrote:
    > I am not a newbie to PHP, but have not touched it for a while, and now I
    > need to get back into it for a project. I have the following login page
    > script which I am using to test a DB connection to mySQL. I have checked
    > that mySQL is started up but i get a parse error on line 23 (asterisked
    > below). Can anyone shed some light? Its probably something really stoopid
    > i
    > know...


    mysql_select_db("images, $db");
    should be
    mysql_select_db("images", $db);

    --
    Tom Thackrey
    [url]www.creative-light.com[/url]
    Tom Thackrey Guest

  2. Similar Questions and Discussions

    1. problem connecting from cf 6.0 to mysql 5
      Hey guys, Heres my problem I can't connect to mysql after i upgraded to v5 it says: Connection verification failed for data source: eval...
    2. Connecting with MySQL
      How I do to connect the ColdFusion with MySQL? I read http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=6ef0253 page, but it doesn't works...
    3. Problem connecting MySQL in MX Admin Panel
      I am using Dreamweaver MX 6.1 and ColdFusion MX Server Administrator. OBDC Driver is Microsoft MySQL 3.5.1. The driver is set up under Microsoft...
    4. beginner question, problem connecting to mysql
      hi all, i have problem with my php-mysql connection. i got "Fatal error: Call to undefined function: mysql_connect()" when i try to use mysql...
    5. PostgreSQL/mySQL: connecting, login code problem.
      Hey, Hours ... I am searching I have these code and we found it's postgreSQL. Now we have mysql, isn't it possible to change the connect code and...
  3. #2

    Default Re: problem connecting to mySQL

    Thanks for all that, i have been completely stitched up since this code
    comes from "PHP for web professionals" (!).

    --
    reply email is not valid. Correct address is garry DOT junk AT blueyonder
    DOT co DOT uk
    "Tom Thackrey" <tomnr@creative-light.com> wrote in message
    news:r5%Na.352$Sg6.120@newssvr16.news.prodigy.com. ..
    >
    > On 6-Jul-2003, "GazK" <wrong@wrong.co.uk> wrote:
    >
    > > thanks for that, but its still failing on line 23!
    > >
    > > --
    > > reply email is not valid. Correct address is garry DOT junk AT
    blueyonder
    > > DOT co DOT uk
    > > "Tom Thackrey" <tomnr@creative-light.com> wrote in message
    > > news:4ZYNa.453$Vs.50961448@newssvr14.news.prodigy. com...
    > > >
    > > > On 6-Jul-2003, "GazK" <wrong@wrong.co.uk> wrote:
    > > >
    > > > > I am not a newbie to PHP, but have not touched it for a while, and
    now
    > > > > I
    > > > > need to get back into it for a project. I have the following login
    > > > > page
    > > > > script which I am using to test a DB connection to mySQL. I have
    > > > > checked
    > > > > that mySQL is started up but i get a parse error on line 23
    > > > > (asterisked
    > > > > below). Can anyone shed some light? Its probably something really
    > > stoopid
    > > > > i
    > > > > know...
    > > >
    > > >
    > > >
    > > > mysql_select_db("images, $db");
    > > > should be
    > > > mysql_select_db("images", $db);
    >
    >
    > Sorry, I didn't spot all the other errors...
    >
    > 1 You have colons at the end of your if and else statements, remove them.
    > 2 There is no endif statement in php, remove them, too. If you need
    multiple
    > statements in an if or else block use { and } to group them.
    > 3 Your HTML has </br> which should be <br /> or <br>
    > 4 The string in line 21 is wrong, it should be
    >
    > print("can\'t connect/n");
    >
    > Note that /n will not produce a new line in the browser only in the HTML
    > source, use <br> if you want a new line in the browser.
    >
    > There may be others, but these are the ones I spotted on reading the code.
    >
    > --
    > Tom Thackrey
    > [url]www.creative-light.com[/url]

    GazK Guest

  4. #3

    Default Re: problem connecting to mySQL

    PS correcting the
    print("cant connect/n");

    line has allowed the code to get to line 48 before stalling. Thanks for
    getting me some progress!


    --
    reply email is not valid. Correct address is garry DOT junk AT blueyonder
    DOT co DOT uk
    "Tom Thackrey" <tomnr@creative-light.com> wrote in message
    news:r5%Na.352$Sg6.120@newssvr16.news.prodigy.com. ..
    >
    > On 6-Jul-2003, "GazK" <wrong@wrong.co.uk> wrote:
    >
    > > thanks for that, but its still failing on line 23!
    > >
    > > --
    > > reply email is not valid. Correct address is garry DOT junk AT
    blueyonder
    > > DOT co DOT uk
    > > "Tom Thackrey" <tomnr@creative-light.com> wrote in message
    > > news:4ZYNa.453$Vs.50961448@newssvr14.news.prodigy. com...
    > > >
    > > > On 6-Jul-2003, "GazK" <wrong@wrong.co.uk> wrote:
    > > >
    > > > > I am not a newbie to PHP, but have not touched it for a while, and
    now
    > > > > I
    > > > > need to get back into it for a project. I have the following login
    > > > > page
    > > > > script which I am using to test a DB connection to mySQL. I have
    > > > > checked
    > > > > that mySQL is started up but i get a parse error on line 23
    > > > > (asterisked
    > > > > below). Can anyone shed some light? Its probably something really
    > > stoopid
    > > > > i
    > > > > know...
    > > >
    > > >
    > > >
    > > > mysql_select_db("images, $db");
    > > > should be
    > > > mysql_select_db("images", $db);
    >
    >
    > Sorry, I didn't spot all the other errors...
    >
    > 1 You have colons at the end of your if and else statements, remove them.
    > 2 There is no endif statement in php, remove them, too. If you need
    multiple
    > statements in an if or else block use { and } to group them.
    > 3 Your HTML has </br> which should be <br /> or <br>
    > 4 The string in line 21 is wrong, it should be
    >
    > print("can\'t connect/n");
    >
    > Note that /n will not produce a new line in the browser only in the HTML
    > source, use <br> if you want a new line in the browser.
    >
    > There may be others, but these are the ones I spotted on reading the code.
    >
    > --
    > Tom Thackrey
    > [url]www.creative-light.com[/url]

    GazK Guest

  5. #4

    Default Re: problem connecting to mySQL

    "GazK" <wrong@wrong.co.uk> wrote in message
    news:<am_Na.349$UN5.285@news-binary.blueyonder.co.uk>...
    > "Tom Thackrey" <tomnr@creative-light.com> wrote in message
    > news:4ZYNa.453$Vs.50961448@newssvr14.news.prodigy. com...
    > >
    > > mysql_select_db("images, $db");
    > > should be
    > > mysql_select_db("images", $db);
    >
    > thanks for that, but its still failing on line 23!
    What's the error message?

    Cheers,
    NC
    Nikolai Chuvakhin Guest

  6. #5

    Default Re: problem connecting to mySQL

    In article <7MDOa.86$AK5.76@news-binary.blueyonder.co.uk>,
    [email]wrong@wrong.co.uk[/email] says...
    > [Mon Jul 07 22:08:34 2003] [error] [client 127.0.0.1] Premature end of
    > script headers: d:/program files/nusphere/apache/php/php.exe
    >
    > ....?
    >
    > --
    > reply email is not valid. Correct address is garry DOT junk AT blueyonder
    > DOT co DOT uk
    > "David Robley" <robleyd@ozemail.com.oz> wrote in message
    > news:MPG.197570493b1b13489896bc@news.spiderweb.com .au...
    > > In article <DPhOa.159$S95.8@news-binary.blueyonder.co.uk>,
    > > [email]wrong@wrong.co.uk[/email] says...
    > > > Cleared the error at line 48, I now get the login window, however
    > whatever
    > > > username/password i put in, i get the following. Can anyone clear me
    > over
    > > > the last hurdle?
    > > >
    > > > Internal Server Error
    > > > The server encountered an internal error or misconfiguration and was
    > unable
    > > > to complete your request.
    > > > Please contact the server administrator, [email]you@your.addr[/email]ess and inform
    > them of
    > > > the time the error occurred, and anything you might have done that may
    > have
    > > > caused the error.
    > > >
    > > > More information about this error may be available in the server error
    > log.
    > >
    > > If you have access to the log.....
    The error suggests there may be more info in the server log.

    --
    Quod subigo farinam

    $email =~ s/oz$/au/o;

    David Robley Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139