I have using php5-mysql system-Ubantu 13.10, I setup my project but when i login for my first page it give me [:error] [pid 16033] [client 127.0.0.1:53154] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/Scada/Fleet/phpcmd/login.php on line 29, can you please tell me how I can make my environment compatible to work with the code.
            Asked
            
        
        
            Active
            
        
            Viewed 352 times
        
    -6
            
            
        - 
                    1don't use *mysql_* functions use **mysqli_** or **PDO** instead – donald123 Jan 09 '15 at 11:12
- 
                    1It's exactly like the error says. – Matheno Jan 09 '15 at 11:13
- 
                    1The question already has an answer here http://stackoverflow.com/questions/13944956/the-mysql-extension-is-deprecated-and-will-be-removed-in-the-future-use-mysqli – Delphin Sam Jan 09 '15 at 11:16
- 
                    I use mysqli_connect() but its not work. Please tell me how I chnage my environment compatible please... – PradeepR Jan 09 '15 at 11:24
- 
                    1"it does not work". How are we supposed to know what doesn't work? Does your server explode? Does your browser crash? Can it not reboot? Do you get a PHP error? A PHP notice? What error? What notice? See if you can figure out what's wrong with my car, using this description: "my car does not work. Please tell me how I can fix it please" – h2ooooooo Jan 09 '15 at 11:47
- 
                    Possible duplicate of [The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead](https://stackoverflow.com/questions/13944956/the-mysql-extension-is-deprecated-and-will-be-removed-in-the-future-use-mysqli) – Jonas Czech Oct 24 '19 at 19:31
2 Answers
3
            
            
        change Line 29 /var/www/Scada/Fleet/phpcmd/login.php on line 29
from  mysql_connect() to  mysqli_connect()
you have to change all mysql statements to mysqli statements to get it work. Or you use PDO.
 
    
    
        goldlife
        
- 1,949
- 3
- 29
- 48
-2
            
            
        Do
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
in your index.php or the first line of /var/www/Scada/Fleet/phpcmd/login.php
or use mysqli or PDO instead of the old mysql extensions.
 
    
    
        Dennis Stücken
        
- 1,296
- 9
- 10
- 
                    When he is not the developer of that tool, why should he fix all the code? He just wanted to have a working environment. – Dennis Stücken Jan 09 '15 at 11:17
- 
                    
- 
                    
