Jump to content

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


hopakos

Recommended Posts

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
 

Link to comment
Share on other sites

  • 1 month later...

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();
}

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...