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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...