Welcome Guest, Not a member yet? Register   Sign In
mysql_escape_string
#7

[eluser]Pavellicus[/eluser]
SOLVED!

if you change version of PHP from 5.3 to 5.4 you must change the hostname

config/database.php

from
Code:
$db['default']['hostname'] = 'localhost';
to
Code:
$db['default']['hostname'] = '127.0.0.1';

if you need to undestand better your problem use this code inside the page


Code:
database.php
...
...

echo '<pre>';
  print_r($db['default']);
  echo '</pre>';

  echo 'Connecting to database: ' .$db['default']['database'];
  $dbh=mysql_connect
  (
    $db['default']['hostname'],
    $db['default']['username'],
    $db['default']['password'])
    or die('Cannot connect to the database because: ' . mysql_error());
    mysql_select_db ($db['default']['database']);

    echo '<br />   Connected OK:'  ;
    die( 'file: ' .__FILE__ . ' Line: ' .__LINE__);


Messages In This Thread
mysql_escape_string - by El Forum - 12-08-2013, 09:42 AM
mysql_escape_string - by El Forum - 12-08-2013, 12:54 PM
mysql_escape_string - by El Forum - 12-09-2013, 12:21 AM
mysql_escape_string - by El Forum - 12-09-2013, 02:50 AM
mysql_escape_string - by El Forum - 12-09-2013, 03:45 AM
mysql_escape_string - by El Forum - 12-09-2013, 10:22 AM
mysql_escape_string - by El Forum - 12-09-2013, 10:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB