Thomisback Posted June 20, 2008 Share Posted June 20, 2008 Hi, Some of my mysql queries crash in Internet Explorer while in Firefox they work fine! For example: $planetrow = doquery("SELECT * FROM {{table}} WHERE id={$user['current_planet']}",'planets',true); Works in Firefox but crashes in Internet explorer. The "doquery" function: function doquery($query, $table, $fetch = false){ global $link,$debug,$ugamela_root_path; @include($ugamela_root_path.'config.php'); if(!$link) { $link = odbc_connect($dbsettings["server"], $dbsettings["user"], $dbsettings["pass"]) or $debug->error(odbc_error()."<br />$query","SQL Error"); //message(mysql_error()."<br />$query","SQL Error"); odbc_select_db($dbsettings["name"]) or $debug->error(odbc_error()."<br />$query","SQL Error"); } // por el momento $query se mostrara // pero luego solo se vera en modo debug $sqlquery = odbc_exec($query, str_replace("{{table}}", $dbsettings["prefix"]. $table)) or $debug->error(odbc_error()."<br />$query","SQL Error"); //message(mysql_error()."<br />$query","SQL Error"); unset($dbsettings); global $numqueries,$debug;//,$depurerwrote003; $numqueries++; //$depurerwrote003 .= ; $debug->add("<tr><th>Query $numqueries: </th><th>$query</th><th>$table</th><th>$fetch</th></tr>"); if($fetch) { //hace el fetch y regresa $sqlrow $sqlrow = odbc_fetch_array($sqlquery); return $sqlrow; }else{ //devuelve el $sqlquery ("sin fetch") return $sqlquery; } } config.php: <?php if(!defined("INSIDE")){ die("attemp hacking");} $dbsettings = Array( "server" => "localhost" "user" => "", "pass" => "", "name" => "", "prefix" => "ugml_", "secretword" => "secret"); $api_key = 'ad5fdcd2a31e8863e7c83a8c04aa6f4d'; $secret = 'b04d7ead5b37d1da2710fc8d66ea8311'; // The IP address of your database $db_ip = 'localhost'; $db_user = ''; $db_pass = ''; $db_name = ''; ?> I have been looking for an answer for a while now but I really can't solve it, someone please help me. Kind regards. Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 that's weird. there is no way a query will crash on a browser since it is parsed at the server and not at the client. can you post the error? Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 This is driving me crazy, I just checked my error log and the only thing it says after I loaded the page is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' at line 1 SELECT * FROM ugml_errors WHERE id= Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 that's a query error and browser ahs nothing to do with it. can you post the query? Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 Query is at the top of the first post Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 i mean the query created after that, the actual query sent. Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 $planetrow = mysql_query("SELECT * FROM ugml_planets WHERE id=1985"); $planetrow = mysql_fetch_array($planetrow); return $planetrow; Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 the error query posted something is wrong with this: SELECT * FROM ugml_errors WHERE id= which is far from the one you posted: SELECT * FROM ugml_planets WHERE id=1985 there was an error because table ugml_errors does not exist i suppose? Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 The table ugml_errors exists :/ I can't find the query which tries to alter it... It must be in one of the [insert large number here] includes. Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 Wait I get it, there is an error in the "Error viewer" causing the uglm_error error. The uglm_planets doesn't return anything... Well, that's the most likely thing I guess. Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 most likely... since equating something to nothing returns an error. Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 Thanks I got it working now Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 welcome... Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 20, 2008 Author Share Posted June 20, 2008 After I solved this I got the same problem over and over again so I downloaded everything to my Localhost and tested it and came to the conclusion everything worked fine! Even in Internet Explorer, I think it must have been my hosting server? Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 21, 2008 Share Posted June 21, 2008 try checkin your code first, maybe it was configured to work only in your unit... check the proper settings for your hosting site. if everything is alright, ask your hosting site for possible answers. Quote Link to comment 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.