pragmaMx Support Forum

pragmaMx => Individuelle Anpassungen => Thema gestartet von: alexandrevatin am 21 Januar 2015, 21:44:21

Titel: CONNECTING TO THE DATABASE VIA PDO
Beitrag von: alexandrevatin am 21 Januar 2015, 21:44:21
Hello

I use a personal module to display a table.
With the new connection to the database since the V2.2.1 BETA I can not do it!
What a piece of code can connect via PDO?

Titel: Re:CONNECTING TO THE DATABASE VIA PDO
Beitrag von: Olaf / TerraProject am 22 Januar 2015, 09:18:42
sorry, the PDO-documentation is not finished yet  :red:
Please see the file 'includes/mx_database.php' for more information.
the connection of the database can be seen there.
:pardon:
Titel: Re:CONNECTING TO THE DATABASE VIA PDO
Beitrag von: alexandrevatin am 22 Januar 2015, 12:17:00
Hello

Thank you for the info :thumbup:
I tried with my little knowledges
like making a include but without success.
that's why I keep my old solution :red:
   
      $host = "******";
$bdd = "******";
$user = "******";
$pwd = "******";
      mysql_connect($host,$user,$pwd) or die("Pb de connexion au serveur $host");

apart the special characters it works !
it is a module only visible for Administrator so no problem.
Perhaps with the doc will be easier :bye:
Titel: Re:CONNECTING TO THE DATABASE VIA PDO
Beitrag von: Olaf / TerraProject am 22 Januar 2015, 17:26:50
used in the complete code instead of the php commands 'mysql_xxxxxx'  the commands 'sql_xxxxxx'
donT use the command mysql_connect() and mysql_select_db() ! This makes pmx already :D

then it goes.