caryhartline Posted October 14, 2011 Share Posted October 14, 2011 I have looked all over the Internet for the answer so please critizise on something that is probably dumb. I have this code for the header on my website and it recently started saying: Fatal error: Call to undefined function MySQLError() in /hermes/bosweb/web272/b2720/ipg.caryhartline/themes/default/header.php.html on line 11 This doesn't happen on every page. It only happens when someone logs into their account. Please help! This is the code: <? header( 'Content-type: text/html; charset=\"charset=utf-8\"' ); //iso-8859-1 ?> <? // get balance information $query = "select * from BPLA_users where nick='".$_SESSION['BPLowbidAuction_LOGGED_IN_USERNAME']."'"; $result = @mysql_query($query); $TPL_balance = "00.00"; if(!$result) { MySQLError($query); exit; } else { $USER = mysql_fetch_array($result); $TPL_balance = number_format($USER['balance'], 2, '.', ''); } $is_pre_registration = (isset($_REQUEST['pre_registration']) && ($_REQUEST['pre_registration'] == "1")) ? "1" : ""; #// Build the page width string //$PAGEWIDTH = $SETTINGS['pagewidth']; //if($SETTINGS['pagewidthtype'] == 'perc') $PAGEWIDTH .= "%"; $PAGEWIDTH = "100%"; if ($HTTPS == '1' || $HTTPS == 'on') { $SITEURL = $Https['httpsurl']; $SETTINGS['siteurl'] = $Https['httpsurl']; } else { $SITEURL = $SETTINGS['siteurl']; $SETTINGS['siteurl'] = $SETTINGS['siteurl']; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/249155-fatal-error-call-to-undefined-function-mysqlerror/ Share on other sites More sharing options...
markjoe Posted October 14, 2011 Share Posted October 14, 2011 Do you mean to be using mysql_error()? Quote Link to comment https://forums.phpfreaks.com/topic/249155-fatal-error-call-to-undefined-function-mysqlerror/#findComment-1279509 Share on other sites More sharing options...
Pikachu2000 Posted October 14, 2011 Share Posted October 14, 2011 Judging by the fact that the query string is being passed to it as a parameter, it looks like a user defined function that would probably be include()d from an external file. Is the MySQLError() function defined somewhere? Quote Link to comment https://forums.phpfreaks.com/topic/249155-fatal-error-call-to-undefined-function-mysqlerror/#findComment-1279510 Share on other sites More sharing options...
caryhartline Posted October 14, 2011 Author Share Posted October 14, 2011 I think you are talking about this code. <? if(!defined('INCLUDED')) exit("Access denied"); if(!function_exists(MySQLError)) { Function MySQLError($Q) { global $SESSION_NAME, $SESSION_ERROR, $ERR_0001; $SESSION_ERROR = $ERR_001."<br>".$Q."<br>".mysql_error(); $_SESSION["SESSION_ERROR"]=$SESSION_ERROR; print "<SCRIPT LANGUAGE=Javascript>document.location.href='error.php'</SCRIPT>"; return; } } ?> This is from a file called error.inc.php. I think it is included because the file error.php includes this code and requires header.php which includes the file header.php.html that I originally posted. Quote Link to comment https://forums.phpfreaks.com/topic/249155-fatal-error-call-to-undefined-function-mysqlerror/#findComment-1279521 Share on other sites More sharing options...
caryhartline Posted October 15, 2011 Author Share Posted October 15, 2011 OK, I found another file that may be involved. There is this code called user_menu.php which takes part in the process of http://www.luvbid.com/user_menu.php and creates an error whether someone is logged in or not. Is there a problem in this code that may be causing this? [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/249155-fatal-error-call-to-undefined-function-mysqlerror/#findComment-1279647 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.