Jump to content

bill-lancaster

Members
  • Posts

    16
  • Joined

  • Last visited

bill-lancaster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm getting errors reported as well. Thanks again.
  2. How stupid of me, I assumed that php-mysql was installed - it wasn't. sudo apt-get install php5-mysql Results in a successful connection. Sorry to have wasted your time - at least I learned to use PDO! Thanks again.
  3. Yes, it shows /etc/php5/apache2/php.ini as the loaded config file
  4. Thanks, have set /etc/php5/apache2/php.ini as sugested then restarted apache I added this to a simple index.php file $db = new PDO('mysql:host=localhost;dbname=gwl', 'root', 'alex23'); echo "after"; Still no error reported and no echo after the call to PDO
  5. I'm very new php. Have been using mysql for many years but only on a pc (ie not networked). I have set up a pc on my lan as a server and can access it from the local network. I'm having trouble connecting to the mysql db installed on the server pc. The following simple code echos 'start' as in first php line, nothing is output after that. Not even 'Connection failed:' <!DOCTYPE html> <html> <body> <h1>test php</h1> <?php echo "start"; $servername = "localhost"; $username = "username"; $password = "password"; // Create connection $conn = mysql_connect($servername, $username, $password); echo "after"; // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully";?> </body> </html> The server is running Kubuntu 14.04 mysql V14.14 php V5.5.9-1ubuntu4.11 Hope someone has some ideas.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.