RootsPersona 3.3.3 works fine with:
as long as the following changes are made because the mysql extension was eliminated on PHP 7:
The mysql statements
$new_link = true;
$conn = mysql_connect( $credentials->hostname, $credentials->dbuser, $credentials->dbpassword, $new_link );
if ( ! $conn ) {
throw new Exception( 'could not connect to database' );
}
mysql_select_db( $credentials->dbname );
mysql_set_charset( 'utf8', $conn );
becomes the PDO equivalent:
try {
$dsn = 'mysql:host=' . $credentials->hostname . ';dbname=' . $credentials->dbname . ';charset=utf8';
$conn = new PDO($dsn, $credentials->dbuser, $credentials->dbpassword);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
return $conn;
The mysql statements
return mysql_query( $sql, $this->connection );
becomes the PDO equivalent:
$stmt = $this->connection->prepare( $sql );
$stmt->execute();
return $stmt->fetchAll();
The mysql statements
while ( $row = mysql_fetch_array( $result ) ) {
$tab[$i++] = $row;
}
mysql_free_result( $result );
becomes the PDO equivalent:
foreach($result as $row) {
$tab[$i++] = $row;
}
The mysql statements
mysql_close( $connection );
becomes the PDO equivalent:
$connection = null;
The mysql statements
return mysql_affected_rows( $connection );
becomes the PDO equivalent:
return $result->rowCount();
The mysql statements
return mysql_insert_id();
becomes the PDO equivalent:
return $this->connection->lastInsertId();
The mysql statements
$row = mysql_fetch_array( $result );
becomes the PDO equivalent:
if ( $result[0] ) return $result[0][0];
The mysql statements
$this->connection->execute_query( 'BEGIN' );
becomes the PDO equivalent:
$this->connection->beginTransaction();
The mysql statements
$this->connection->execute_query( 'COMMIT' );
becomes the PDO equivalent:
$this->connection->commit();
The mysql statements
$this->connection->execute_query( 'ROLLBACK' );
becomes the PDO equivalent:
$this->connection->rollBack();
The mysql statements
$value = mysql_escape_string( $value );
is included in the PDO statement prepare( $sql )
https://www.ads-software.com/plugins/rootspersona/
]]>Memory limit: 256M
Maximum execution time: 30 seconds
PHP version : 5.4.24
MySQL version : 5.1.63
The 30 sec execution time may seem short, but I think it can be done. All files + DB is about 95MB.
Just wanted to provide you as much info as possible about the problem. I think the concept is great.
—————–
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/domain/public_html/wp-content/plugins/wp-clone-by-wp-academy/lib/functions.php on line 245
The plugin encountered an error while cloning the database,the following error message was returned:
Error Message : MySQL server has gone away
Temporary files created in /home/domain/public_html/wp-content/wpclone-temp will be deleted.
https://www.ads-software.com/plugins/wp-clone-by-wp-academy/
]]>i installed shoutbox on a page (by using template), the public window shows the following message :
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in …/public_html/vihegay/wp-content/plugins/pierres-wordspew/usersonline.php on line 72
Can someone tell me what i must do ? Not so experienced in php, please tell me clearly if you have an idea…
Thanks a lot !
https://www.ads-software.com/extend/plugins/pierres-wordspew/
]]>I did notice these two warnings the last couple of days:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home-directory/wp-content/plugins/xcloner-backup-and-restore/cloner.functions.php on line 1996
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home-directory/wp-content/plugins/xcloner-backup-and-restore/cloner.functions.php on line 2005
It started happening two days ago, and the only change on my site and web server I know of is that my host did some upgrade to the web server so MySQL might have been upgraded (Current version: 5.1.63-cll). In fact the warnings started showing up after the server upgrade was done.
I just wanted to let you know about the warnings, and to see if they are anything I should be concerned of.
Otherwise, thank you again for the great plugin!
https://www.ads-software.com/extend/plugins/xcloner-backup-and-restore/
]]>For example:
while ($row = mysql_fetch_assoc($results)){
// Do code to process db results here.
}
How would I write this using the $wpdb class?
]]>I’m wondering if it’s possible to use mysql_fetch_array to generate submenu pages based on data in the database.
Each site has it’s own unique table (wp_1_ksettings, wp_2_kpsettings, wp_3_kpsettings) with unique data in it. The columns will contain the strings needed for the options, identifier, and etc used in this line:
add_submenu_page(__FILE__, $row['option_name'], $row['option_name'], $row['capability'], $row['identifier'], $row['identifier']);
It’s kinda complex and I’m sure there’s another way to do this but I just can’t think of it. If anyone out there has any ideas or other suggestions it would be greatly appreciated.
//Add a menu to the top level
add_action('admin_menu', 'Add_kp_plugin');
//Add a main menu for the plugin
function Add_kp_plugin() {
if (function_exists('add_menu_page')){
add_menu_page('KP Settings', 'KP Settings', 2, __FILE__, 'startup');
global $wpdb;
$result = mysql_query("SELECT * FROM wp_" $wpdb->$siteid . "_kpsettings");
while($row = mysql_fetch_array($result))
{
add_submenu_page(__FILE__, $row['option_name'], $row['option_name'], $row['capability'], $row['identifier'], $row['identifier']);
}
}
}
]]>