Jump to content

Edit History

Gian Luca

Gian Luca

ok provo a postarti la parte di codice della connessione, tanto oltre non vado :)

FILE: app/config/parameters.php

	<?php return array (
	  'parameters' => 
	  array (
		'database_host' => '127.0.0.1',
		'database_port' => '',
		'database_name' => 'database_PS',
		'database_user' => 'user_PS',
		'database_password' => '*******',
		'database_prefix' => 'ps_',
		'database_engine' => 'InnoDB',
		'mailer_transport' => 'smtp',
		'mailer_host' => '127.0.0.1',
		'mailer_user' => NULL,
		'mailer_password' => NULL,
		'secret' => '00000000000000000000000000000000',
		'ps_caching' => 'CacheMemcache',
		'ps_cache_enable' => false,
		'ps_creation_date' => '2019-06-15',
		'locale' => 'it-IT',
		'cookie_key' => '00000000000000000000000',
		'cookie_iv' => '6tkBDOi4',
		'new_cookie_key' => '00000000000000000000',
	  ),
	);

 

 

File: FILE: /update.php

<?php

include ('/var/www/vhosts/my-site.ch/httpdocs/app/config/parameters.php');

// DATI CONNESSIONE DB
	$servername = "127.0.0.1";
	$db_name    = "database_PS";
	$username   = "user_PS";
	$password   = '*******';
	$database_prefix = "ps_";
 // ===> (questi dati non riesco a richiamarli dal'include)


// CONNESSIONE AL DB
try {
    $db = new PDO("mysql:host=$servername;dbname=".$db_name."", $username, $password);
    // set the PDO error mode to exception
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "<hr /><p><strong>Siamo qui</strong> - <strong>Connesso con successo</strong></p>"; 
    }
catch(PDOException $e)
    {
    echo "<hr /><p><strong>Siamo qui</strong> - <strong>Connessione Fallita</strong>: " . $e->getMessage() . "</p>";
    }


// da qui in poi il resto dellos cript che funziona una volta collegato al DB

 

 

Grazie

Gian Luca

Gian Luca

ok provo a postarti la parte di codice della connessione, tanto oltre non vado :)

FILE: app/config/parameters.php

	<?php return array (
	  'parameters' => 
	  array (
		'database_host' => '127.0.0.1',
		'database_port' => '',
		'database_name' => 'database_PS',
		'database_user' => 'user_PS',
		'database_password' => '*******',
		'database_prefix' => 'ps_',
		'database_engine' => 'InnoDB',
		'mailer_transport' => 'smtp',
		'mailer_host' => '127.0.0.1',
		'mailer_user' => NULL,
		'mailer_password' => NULL,
		'secret' => '00000000000000000000000000000000',
		'ps_caching' => 'CacheMemcache',
		'ps_cache_enable' => false,
		'ps_creation_date' => '2019-06-15',
		'locale' => 'it-IT',
		'cookie_key' => '00000000000000000000000',
		'cookie_iv' => '6tkBDOi4',
		'new_cookie_key' => '00000000000000000000',
	  ),
	);

 

 

File: FILE: /update.php

<?php

include ('/var/www/vhosts/my-site.ch/httpdocs/app/config/parameters.php');

// DATI CONNESSIONE DB
	$servername = "127.0.0.1";
	$db_name    = "database_PS";
	$username   = "user_PS";
	$password   = '*******';
	$database_prefix = "ps_";
 // ===> (questi dati non riesco a richiamarli dal'include)


// CONNESSIONE AL DB
try {
    $db = new PDO("mysql:host=$servername;dbname=".$db_name."", $username, $password);
    // set the PDO error mode to exception
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "<hr /><p><strong>Siamo qui</strong> - <strong>Connesso con successo</strong></p>"; 
    }
catch(PDOException $e)
    {
    echo "<hr /><p><strong>Siamo qui</strong> - <strong>Connessione Fallita</strong>: " . $e->getMessage() . "</p>";
    }


// da qui in poi il resto dellos cript che funziona una volta collegato al DB

 

×
×
  • Create New...