hopakos Posted November 15, 2014 Posted November 15, 2014 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.phpI have download this from this section and i cant understand the main language. thx
Lavos Posted December 26, 2014 Posted December 26, 2014 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();}
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now