Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

BitNami WAMP Stack

Contains ApacheLounge build

Mysql connect issue from one script but not others..

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner

View previous topic :: View next topic  
Author Message

Joined: 21 Oct 2006
Posts: 3
Location: Orlando FL.

PostPosted: Sat 17 Feb '07 1:17    Post subject: Mysql connect issue from one script but not others.. Reply with quote

Just throwing this out to see if anyone might have an answer.
I have a simple include file for the standard Mysql connection.

I can access the database / tables with all other scripts fine with the exception of one, and I get this error when checking a query from an insert.

Can't connect to MySQL server on 'localhost' (10061)

I have looked up the error but have found nothing that seems to be the problem. I have phpmyadmin working fine aswell as a few phpbb forums.

Also a few of my own wip web apps are working also using this same included connect below, edited of course with the right info.

I'm open for any ideas.

My connect script looks like:

$some_guest = @mysql_pconnect('.', 'some_guest', 'some_guest');
if (!$some_guest){
exit ('User guest is unable to log in.');

mysql_select_db("this_general_db") or
die ("ERROR: unable to connect to database");
Back to top
James Blond

Joined: 19 Jan 2006
Posts: 6311
Location: Germany, Next to Hamburg

PostPosted: Mon 19 Feb '07 10:30    Post subject: Reply with quote

Sure that the script is executed? Maybe some issue with short php tags.
Run your include file alone, remove the @ so that you can see if there is an error. You also could add error_reporting(E_ALL); in the first line to see more debugging information.

Improve your errorhandling


if (!mysql_select_db("nonexistentdb", $link)) {
   echo mysql_errno($link) . ": " . mysql_error($link). "\n";

see the docs your more details

Back to top

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1