mysqli_real_connect: warning

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
piratos

Re: mysqli_real_connect: warning

Post by piratos »

The mysqli - error must be a adodb error or otherwise.

Test your mysqli - installation as follow and dirctly

Code: Select all

<?php 

/*
Zuerst erzeugen wir ein neues Objekt mit dem Namen $mysqli und verbinden uns zum Server. Ab sofort werden wir nur noch auf das Objekt zugreifen

server, user, password, database
*/

$mysqli = new mysqli('localhost', 'root', 'yourpassword', 'cmsfrisch'); 


/*
Wir prüfen, ob es zu einem Fehler kam beim Verbindungsaufbau mit der Datenbank. Sofern dies zutrifft, brechen wir das Script durch die() ab.
*/
if (mysqli_connect_errno()) { 
   die("Konnte keine Verbindung herstellen");
} 

/*
Wir rufen nun verschiedene Daten aus der Datenbank ab. Sofern die Abfrage erfolgreich war, wird die das Ergebnis in der Variable $result gespeichert. Man beachte, dass wir das Query als Objektfunktion $mysqli->query abrufen
*/
if ($result = $mysqli->query('SELECT content FROM cms_content_props')) { 


    /*
    Hier bilden einen Array und geben das Ergebnis aus
    */
    while( $row = $result->fetch_assoc() ){ 
        echo "Inhalt: ". $row["content"];
    } 

    /*
    Wir geben den Speicher frei.
    */
    $result->close(); 
} 
/*
Dies ist Meldung, sofern keine Daten aus der Datenbank ausgelesen werden können.
*/
else {
    echo "Es konnten keine Daten aus der Datenbank ausgelesen werden";
}


/*
Verbindung trennen.
*/
$mysqli->close(); 
?>
If it run there was an error in adodb or in cms.

You can also run phpmyadmin with mysqli as follow.
change this

Code: Select all

$cfg['Servers'][$i]['extension']     = 'mysql';     // The php MySQL extension to use ('mysql' or 'mysqli')
to

Code: Select all

$cfg['Servers'][$i]['extension']     = 'mysqli';     // The php MySQL extension to use ('mysql' or 'mysqli')
and restart phpmyadmin. Now it will use mysqli.
piratos

Error in install.php

Post by piratos »

There is an error in install.php, if you wish to use mysql 4.1 the installation failed.

This is the reason:

Bad Code:

Code: Select all

$result = $db->Connect($_POST['host'].":".$_POST['port'],$_POST['username'],$_POST['password'],$_POST['database']);
Good code

Code: Select all

$result = $db->Connect($_POST['host'].",$_POST['username'],$_POST['password'],$_POST['database']);
AND in lib/adodb/datadic must the datadic-generic-inc.php be installed.

I use for this test adodb 4.61
piratos

Re: mysqli_real_connect: warning

Post by piratos »

My test works successfully with 0.9

With 0.9rc4 the Data  from  initial.sql are not completly  tranferred in Mysql 4.10  with mysqli. At this time i have no idea why it is so.

As example this text is broken "Congratulations!  You now have a fully functional installation of CMS and you are almost ready to start building your site.  First thing though, you should click here to check if your site requires a databa"

Data Import with phpmyadmin with a corrected (prefix) initial.sql  works without sql - errors , but the dataimport is the same as with the install.php - it is broken.
piratos

Re: mysqli_real_connect: warning

Post by piratos »

My PHPmyadmin and cms works with mysqli !

The Format of the initial.sql is wrong for Mysql >= 4.0 and so it is not working with cms and with phpmyadmin and mysqli .

Code: Select all

Original inital

INSERT INTO cms_content_props ( CONTENT_PROP_ID, CONTENT_ID, TYPE, PROP_NAME, PARAM1, PARAM2, PARAM3, CONTENT, CREATE_DATE, MODIFIED_DATE ) VALUES ( null, 1, 'string', 'content_en', null, null, null, '<p>Congratulations!  etc. etc.

Correct working for Mysql 4.10
INSERT INTO `cms_content_props` VALUES (NULL, 1, 'string', 'content_en', NULL, NULL, NULL, '<p>Congratulations!  etc. etc.
Now 0.9rc4 works normaly  with mysqli.
Locked

Return to “[locked] Installation, Setup and Upgrade”