XAMPP 7.2.0 MySQL error: Call to undefined function mysql_se

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP 7.2.0 MySQL error: Call to undefined function mysql_se

Postby lack0Fdesign » 21. April 2018 19:25

error msg: Fatal error: Uncaught Error: Call to undefined function mysql_select_db() in X:\geoLatLng.anm8\public_html\test-02.php:28 Stack trace: #0 {main} thrown in X:\geoLatLng.anm8\public_html\test-02.php on line 28

WAMP server (windows error for anyone searching)

Code: Select all
<?php


// DB

   error_reporting(E_ALL);
   ini_set('display_errors', '1');
   define('DB_HOST', 'localhost');
   define('DB_NAME', 'nuckinfuts');
   define('DB_USER', 'root');
   define('DB_PASSWORD', '');
   
   $con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);
   //echo DB_HOST;
   if (!$con){
      die('Could not connect: ' . mysql_error());
   }
   
   mysql_select_db(DB_NAME, $con) or die(mysql_error());
   
   session_start();
?>


it fails locally but on the live server running FreeBSD I have no issues.

I'm beating my head against the wall, any help would be greatly appreciated.
lack0Fdesign
 
Posts: 2
Joined: 16. February 2018 23:31
XAMPP version: 7.2.2
Operating System: Win XP/7 and ubuntu

Re: XAMPP 7.2.0 MySQL error: Call to undefined function mysq

Postby Altrea » 21. April 2018 22:20

Hi,

This code is a horrible mix of old mysql_ and new mysqli_ functions.
The old functions was removed since PHP 7.0.0-
The only reason it is working on your live host must be an old PHP version.

Change your code to consistently new mysqli_ functions.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10267
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: XAMPP 7.2.0 MySQL error: Call to undefined function mysq

Postby lack0Fdesign » 21. April 2018 23:35

Thanks Andrea, I'll read up when I get free time :/

Most programming books I have are next to the toilet so I can study without kids yelling heheh
lack0Fdesign
 
Posts: 2
Joined: 16. February 2018 23:31
XAMPP version: 7.2.2
Operating System: Win XP/7 and ubuntu

Re: XAMPP 7.2.0 MySQL error: Call to undefined function mysq

Postby shah alam » 24. April 2018 12:05

Upon XAMPP,first I, by mistake sent Mysql login fail error report to Oracle. I understand that any software cannot be activated unless we log into that software concern.So I loggin into sites ofOracle as well as Apachefriends.Now I see that I may log in MySQL but Admin button next to start is not activated. If anybody may help in the name of God who may save our life n afterlife only..Thank you.
shah alam
 
Posts: 1
Joined: 24. April 2018 11:12
XAMPP version: XAMPP-win32-7.1.11-0-VC14
Operating System: windows 7 SP! 32-bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 118 guests