3 Replies Latest reply: Nov 25, 2013 9:06 AM by Teodor Kuduschiev RSS

    Database connections in Mysql 5.5 / 5.15

    whatalotofrubbish Community Member

      For the last 10 years or so I have been using a database connection like the following with no problems:

      <?php

      # FileName="Connection_php_mysql.htm"

      # Type="MYSQL"

      # HTTP="true"

      $hostname_conviewer = "localhost";

      $database_conviewer = "viewbase";

      $username_conviewer = "fred";

      $password_conviewer = "janet";

      $conshipsviewer = mysql_pconnect($hostname_conviewer, $username_conviewer, $password_conviewer) or trigger_error(mysql_error(),E_USER_ERROR);

      ?>

       

      This worked fine on the local machine and also on my hosting providers server, using mysql 5.15.

      Aparantly this server was on its way out so the hosting company  kindly moved my site to another server without telling me first. I only heard about it when an angry customer rang up and asked whats wrong with the web site!

      This new server runs Mysql 5.5+, and consequently, many of the functions are incompatible. So I rewrote the code so that it runs on my CS6 local machine with Xamp and 5.5. Upload it to the site and it will not function. All I get is a blank page with no error messages.

      I looked on the Mysql manual, which is basically a no go area unless you are a bit of a geek, but its free, so I am not complaining.

       

      Questions:

      Is there another method of connecting to a database other than this?

      Does Mysql 5.5 also need a different way of making the connection?

      Where should the connection file be placed on the server?

      Should I be using mysqli and if so where do I get it.

      Would it be a good idea to move on to version 6 - or is that not advisable at this stage.

      Best wishes

      Howard Walker