• Hi just did a server upgrade and now apache error log gives me this:

    mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined function mysql_query() in /home/public_html/wp-content/themes/DynamiX/functions.php:118
    od_fcgid: stderr: Stack trace:
    mod_fcgid: stderr: #0 /home/public_html/wp-includes/plugin.php(235): DYN_page_lists('<li class="page...')
    mod_fcgid: stderr: #1 /home/public_html/wp-includes/post-template.php(1213): apply_filters('wp_list_pages', '<li class="page...', Array, Array)
    mod_fcgid: stderr: #2 /home/public_html/wp-content/themes/DynamiX/functions.php(100): wp_list_pages('echo=0&title_li...')
    mod_fcgid: stderr: #3 /home/public_html/wp-content/themes/DynamiX/header.php(325): DYN_menupages()
    mod_fcgid: stderr: #4 /home/public_html/wp-includes/template.php(572): require_once('/home/...')
    mod_fcgid: stderr: #5 /home/public_html/wp-includes/template.php(531): load_template('/home/...', true)
    mod_fcgid: stderr: #6 /home/public_html/wp-includes/general-template.php(45): locate_template(Array, true)
    mod_fcgid: stderr: #7 /home/public_html/wp-content/themes/DynamiX/page.php(9): get_header()
    mod_fcgid: stderr: #8 /home in /home/public_html/wp-content/themes/DynamiX/functions.php on line 118
    mod_fcgid: stderr: PHP Warning:  Declaration of dyn_walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/public_html/wp-content/themes/DynamiX/functions.php on line 0

    Any help to fix would be really appreciated, it’s using Dynamix theme. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, @soydemadrid. Do you know what version of PHP is running on your server? (The PHP mysql_query function was removed in version 7.0.0, which is why I’m asking.)

    Thread Starter soydemadrid

    (@soydemadrid)

    Hi yes the upgrade was to php 7.0…

    [ No bumping please. ]

    Thread Starter soydemadrid

    (@soydemadrid)

    Here is the code throwing up the issue:

    /***************************************************************/
    /*	Menu Descriptions				  						   */
    /***************************************************************/
    
    function DYN_page_lists($output) {
    	global $wpdb;
    
    	$get_MenuDesc = mysql_query("SELECT p.ID, p.post_title, p.guid, p.post_parent, pm.meta_value FROM " . $wpdb->posts . " AS p LEFT JOIN (SELECT post_id, meta_value FROM " . $wpdb->postmeta . " AS ipm WHERE meta_key = 'pgopts') AS pm ON p.ID = pm.post_id WHERE p.post_type = 'page' AND p.post_status = 'publish' ORDER BY p.menu_order ASC");
    	while ($row = mysql_fetch_assoc($get_MenuDesc)) {
    			extract($row);
    			$post_title = wptexturize($post_title);
    			$data = maybe_unserialize(get_post_meta( $ID, 'pgopts', true ));		
    
    			$menudesc=$data["menudesc"];		
    
    			if($menudesc!="") {
    			$output = str_replace('>' . $post_title .'</a>' , '>' . $post_title . '</a><span class="menudesc">' . $data["menudesc"] . '</span>', $output);
    			}
    
    		}	
    
    			$parts = preg_split('/(<ul|<li|<\/ul>)/',$output,null,PREG_SPLIT_DELIM_CAPTURE);
    			$insert = '<li class="menubreak"></li>';
    			$newmenu = '';
    			$level = 0;
    			foreach ($parts as $part) {
    			if ('<ul' == $part) {++$level; }
    			if ('</ul>' == $part) {--$level;}
    			if ('<li' == $part && $level == 0) {$newmenu .= $insert;}
    			if ('</ul>' == $part && $level == 1) {$newmenu .= $insert_a;}
    			$newmenu .= $part;
    			}
    
    	return $newmenu;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Errors since php and mysql upgrade’ is closed to new replies.