Jump to content

Deprecated: Mysql_Connect(): The Mysql Extension Is Deprecated And Will Be Removed In The Future: Use Mysqli Or Pdo Instead


Recommended Posts

Posted

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\configs\config.php on line 13

 

In this line i have this -->
$open = mysql_connect($sqlhost, $sqluser, $sqlpass) or die("Invalid DB.");

 

 

i search 1st on google and i see an answer to change 

Check this 
http://83.212.122.132/index.php

I have download this from this section and i cant understand the main language. thx
 

  • 1 month later...
Posted

Use mysqli class to connect to a database: check here http://php.net/manual/en/class.mysqli.php

example:

<?php
$mysqli 
= new mysqli("localhost""my_user""my_password""world");
/* check connection */
if ($mysqli->connect_errno) {
    
printf("Connect failed: %s\n"$mysqli->connect_error);
    exit();
}


/* Create table doesn't return a resultset */
if ($mysqli->query("CREATE TEMPORARY TABLE myCity LIKE City") === TRUE) {
    
printf("Table myCity successfully created.\n");
}


/* Select queries return a resultset */
if ($result $mysqli->query("SELECT Name FROM City LIMIT 10")) {
    
printf("Select returned %d rows.\n"$result->num_rows);

    
/* free result set */
    
$result->close();
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..