Updated Mysql

Hei. Im not so good at programming but after an update to MySQL client version: 5.5.31, i get out no result from my database. The data is still in the DB, but the query comes out empty. Is there anyone that sees anything terrible wrong? the same code worked before the update.

<?php include('liga2/admin/user.php'); $connection = mysql_connect("$host","$user","$password") or die(mysql_error()); mysql_select_db("$txt_db_name",$connection) or die(mysql_error()); // //Includes preferences // $pref = mysql_query("SELECT * FROM tplls_preferences WHERE tplls_preferences.id = '1'",$connection) or die(mysql_error()); $pdata = mysql_fetch_array($pref); mysql_free_result($pref); $team_name = $pdata['teamname']; $d_seasonid = $pdata['defaultseasonid']; $show_all_or_one = $pdata['defaultshow']; $show_table = $pdata['defaulttable']; $language = $pdata['defaultlanguage']; $for_win = $pdata['forwin']; $for_draw = $pdata['fordraw']; $for_lose = $pdata['forloss']; $print_date = $pdata['printdate']; $top_bg = $pdata['topoftable']; $bg1 = $pdata['bg1']; $bg2 = $pdata['bg2']; $inside_c = $pdata['inside']; $border_c = $pdata['bordercolour']; $tb_width = $pdata['tablewidth']; $accept_ml = $pdata['acceptmultilanguage']; // //Query to get last updated date and time // //Use site http://www.mysql.com..._functions.html (DATE_FORMAT) //to return date format that fits to your site // $updated_query = mysql_query(" SELECT DATE_FORMAT(last_updated, '%d.%m.%Y at %H:%i') AS last_updated FROM tplls_preferences WHERE ID = '1'", $connection) or die(mysql_error()); $ludata = mysql_fetch_array($updated_query); $last_update = $ludata['last_updated']; mysql_free_result($updated_query); // //If session variables are registered // if(!session_is_registered('defaultlanguage') || !session_is_registered('defaultseasonid') || !session_is_registered('defaultshow') || !session_is_registered('defaulttable')) { $_SESSION['defaultlanguage'] = $language; $_SESSION['defaultseasonid'] = $d_seasonid; $_SESSION['defaultshow'] = $show_all_or_one; $_SESSION['defaulttable'] = $show_table; $defaultlanguage = $_SESSION['defaultlanguage']; $defaultseasonid = $_SESSION['defaultseasonid']; $defaultshow = $_SESSION['defaultshow']; $defaulttable = $_SESSION['defaulttable']; } else { $defaultlanguage = $_SESSION['defaultlanguage']; $defaultseasonid = $_SESSION['defaultseasonid']; $defaultshow = $_SESSION['defaultshow']; $defaulttable = $_SESSION['defaulttable']; } // //Gets seasons and match types for dropdowns // $get_seasons = mysql_query("SELECT * FROM tplls_seasonnames WHERE SeasonPublish = '1' ORDER BY SeasonName",$connection) or die(mysql_error()); // //Sort by points, sort variable is not set // $sort = $_REQUEST['sort']; if(!isset($sort)) { $sort = 'pts'; } ?>

Mysql functions are deprecated, use either mysqli or PDO.

I have provided a complete working PDO database to get you off your obsolete code. You will be up and running in minutes. If you still have a problem we will be happy to help. We cannot support deprecated code.

http://www.phphelp.com/forum/the-occasional-tutorial/beginners-pdo-bumpstart-code-use-it-now!

So, i have tried and failed a few times now, and still nothing. Can maybe someone use the code i have attached and “upgrade” it to myslqi? I know its much, but that would be a lot of help:)

Post your updated code so we can see what is not working. Unless you are planning on hiring someone to upgrade it.

Sponsor our Newsletter | Privacy Policy | Terms of Service