Debugging PHP page which calls self is refused mySQL connection

I have a PHP page. A link on the page calls the page passing parameters to it. At the start of the PHP, I connect to a mySQL server.

When I F11 my way through the page, all is well. When I look at the rendered page by clicking HTML in lower right, I see the page as I expect.

When I click a link on that page, it crashes saying, in the window where the rendered HTML was,

Couldn’t Connect to MySQL Server

\n"); $link2 = mysql_select_db(“qtp_tests”) || die("

Couldn’t Access Database
\n"); } /* *******

and continues with the rest of the PHP code.

I have tried putting a breakpoint before the attempt to connect to the database. I have tried passing link1 (the result of the connection) as a parameter back into the page & only attempt the connection if the parameter is not set.

Have I gone beyond what I should be expecting?

Thanks in advance,

Jim

Are you sure it’s a Komodo bug?
If yes, can you say PHP version you use, Komodo IDE version and example of code?
P.S., I’m reccomend you move to mysqli or PDO mysql, because in PHP >= 5.6 mysql was deprecated and will be removed soon (at now when you try to use mysql_* in PHP5.6, you’ll get critical error: mysql deprecated and will be removed, use mysqli or PDO mysql).

Not sure it’s a bug. But I think I can just work around it.

Anyway to start help you I must know this. :smiley:

How are you triggering debugging? Are you starting the debug session from withing Komodo using F5 or Debug menu > Go or are you using PHP remote debugging to start your session?

The latter is how you should be doing it when debugging a website.

Another question to ask is where is the database? Are you running it locally? or does it have to make a remote call? Is the DB accessible in the first place? You should reproduce the ability to connect to the database in your dev environment, but outside of Komodo to eliminate interference from Komodo.

  • Carey

Resolved due inactivity.