Note that there are some explanatory texts on larger screens.

plurals
  1. PONo database selected on PHP MySQL
    primarykey
    data
    text
    <blockquote> <p>Error: No Database Selected</p> </blockquote> <p>I have a website that was hosted with ARVIXE (windows 2008 server) and presently with IXWEBHOSTING (windows 2003 server). It was very simple to move. It was a matter to just download/upload the site PHP files and export/import MySQL database and change the config PHP file to point to the new database information and voila! </p> <p>Now I am trying to move the site to my own server. Trust me I have no problems with DNS, servers, networking stuff. I've being doing this for 15 years (not programming).<br> This is my actual server: Windows 2003 STD SP2, IIS6, PHP5.2.12, MySQL 5.0.96, FastCGI 1.5. and all MS Updates.</p> <p>Now here me out before you conclude that is the code or MySQL permissions... I have read I think all the No Database Selected errors on the Internet including here and is usually a little code modification or missing code or permission issue on the database...but not this one, see the scenarios below and you will see why not.</p> <ul> <li><p><strong>Scenario 1</strong> PHP Files are sitting in the IXWEBHOSTING servers. The config PHP file points to my own MySQL server it works fine.</p></li> <li><p><strong>Scenario 2</strong> PHP Files are sitting in the IXWEBHOSTING servers. The config PHP file points to IXWEBHOSTING MySQL server it works fine.</p></li> <li><p><strong>Scenario 3</strong> PHP Files are sitting in my Win2k3 servers. The config PHP file points to IXWEBHOSTING MySQL server, I get error "No database selected".</p></li> <li><p><strong>scenario 4</strong> PHP Files are sitting in my Win2k3 servers. The config PHP file points to my own MySQL server, I get error "No database selected".</p></li> </ul> <p>So I know for a fact it has nothing to do with MySQL permission on my own MySQL server or PHO code as scenario 1 proves it. It seems to be a problem with PHP on my server.</p> <p>Prior of installing the OLD PHP and MySQ, I had the lastest version of each PHP 5.3.13 and MySQL 5.5.25 and same FastCGI version. I had the exact same problem!!!! The reason why I installed the old versions is because I wanted to match IXWEBHOSTING server versions.</p> <p>Prior to the above installations, Windows was installed from scratch each time on a hyper-v server. No updates MS updates were done on the server the first attemps and the last installation it has all the MS updates and I still have the same problem.</p> <p>I had the same problem with Windows 2008 STD, PHP 5.3.13 and MySQL 5.5.25.</p> <p>PHP is loading all the proper extensions to make the connections to MySQL. I also have PHPmyAdmin running without problems.</p> <p>I also tried with in the config file and no luck</p> <p>There is a lot of stuff in the index but this is what is needed to make the connection to the database and the query and where it fails.</p> <p><strong>config file</strong></p> <pre><code>&lt;? $usuarios_sesion="youth"; $host="localhost"; $user="usernamehere"; $pass="passwordhere"; $db="databasehere"; $tabla="users"; ?&gt; </code></pre> <p><strong>Index.php File</strong></p> <pre><code>&lt;? require ("enlaces_config.inc.php"); $menu=mysql_query("SELECT id_cat, name_cat FROM categories WHERE access=0 AND published=1") or die ("Can't select categorias MySQL says: ".mysql_error()); ?&gt; </code></pre> <p>At this point I have no idea what else it can be... permissions, maybe but not in MySQL permission, the user has full priviledges to the database. Scenario 1 and 2 proves it too.</p> <p>If you need to check PHP information let me know. I will post the name of the php file for excution</p> <p>Help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload