Hi Gian Luigi, using your extension since a long time, I just bought "professionnal query" because I use now PHP/MySQL on a hosting with PHP7 and I needed to use the MySQLi PHP extension.
Seems to works in DW. I could create a MySQLi connection with a distant MySQL database, with an OK test. I could create a recordset and I could see all the entries of the recordset. This means that the connection is OK from My DW and the distant Database.
But when I put all the files on the server, I get this error : "Fatal error: Uncaught Error: Call to undefined function mysql_select_db() in /home/laudag/immobilier-dubourg/affichettes/affichette-A4-paysage.php:39 Stack trace: #0 {main} thrown in /home/laudag/immobilier-dubourg/affichettes/affichette-A4-paysage.php on line 39".
*Here is the connection script from the file Testaffichette.php (hostname was the server IP and an other test with localhost which worked from my DW and a distant evaluation server configuration) : <?php # FileName="Connection_php_mysql.htm" # Type="MYSQLi" # HTTP="true" $hostname_Testaffichette = "Xxxx"; $database_Testaffichette = "Xxxxxx"; $username_Testaffichette = "Xxxxx"; $password_Testaffichette = "Xxxxxx"; $Testaffichette = new mysqli($hostname_Testaffichette, $username_Testaffichette, $password_Testaffichette, ""); if ($Testaffichette->connect_errno) { echo "Failed to connect to MySQL: (" . $Testaffichette->connect_errno . ") " . $Testaffichette->connect_error; exit(); } ?>
* Here is the recordset script with the line 39 in bold (mysql_select_db($database_Testaffichette, $Testaffichette);), which seems to correspond at a a line with connection to the database : <?php require_once('Connections/Testaffichette.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; }
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } }
mysql_select_db($database_Testaffichette, $Testaffichette); $query_annonces = "SELECT * FROM id83_posts ORDER BY ID DESC"; $annonces = mysql_query($query_annonces, $Testaffichette) or die(mysql_error()); $row_annonces = mysql_fetch_assoc($annonces); $totalRows_annonces = mysql_num_rows($annonces); ?>
What could be the problem ? Is it a bug in your extension ou a problem of compatibility with my hosting (O2Switch) ? Thanks for answering
Laurent DAGANY (France)
|
|
|