tags:

views:

65

answers:

1

I have a strange problem. 5% of its time; i get the error "No Database selected". Only on a page where i use iframes; called from out tab script.

Here is the "sometimes problem" page:

http://www.thediscopalace.com/programtest.php

Every tab calls for a page and loads it into the iframe. The requested page get its content from the database like this:

$rsday1 = mysql_query($query_rsday1, $dbtdp) or die(mysql_error());

The connection is being asked with mysql_pconnect.
I tried mysql_connect but instead I got 100% the error.

I really cannot find the reason; i googled alot. I guess it has something to do with the MySQL; and not with the scripts. Maybe i'm wrong.

This is the used tab script:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

In the iframe i use tje jcarousel:

http://sorgalla.com/jcarousel/

Information about the server here

http://www.thediscopalace.com/info.php

Thanks for helping or passing any ideas. Dave

A: 

Thanks for responding. I made some changes like:
- i put the connection data directly in the requested pages instead of require_once.
- I used < ? instead of < ? php

The user has enough permission to do that task. It remains strange that the erro occured 5% of the time. In the solutions you've passed me; they had always that error.

I will now follow up and see if the error comes back.

Meanwhile, if somebody has some other ideas or resaons; please let me now. It's a kind of magic that happens here; i thought programming was a fact of 1 or 0. Not sometimes 1 or 0. :-)

DaveL
<?php is the correct way to open a PHP tag. Do not use <?
Kristopher Ives