-1

So I downloaded WAMP and i found out that mysql is deprecated, so I wondered if there is anything else that I need to downlaod for WAMP in order of the mysql to work or should I just leave it as it is and dont worry bout it? Not a pro programmer!

After that I ran this code it showed that im connected:

<?php

$conn = mysqli_connect('localhost','root','');

if(!$conn){
    die('Not connected');
}else {
    echo 'Connected';
}

?>
user2864740
  • 60,010
  • 15
  • 145
  • 220
Den
  • 75
  • 6

3 Answers3

3

mysqli and PDO, both php APIs for accessing MySQL, are bundled into WAMP. There's nothing else to download. You should be good to go.

Good for you for noticing the deprecation of mysql!

If you're doing this project to learn about dbms technology in general, you might consider working with PDO: you can use the same APIs (with small variations) to connect to other dbmss, including PostgreSQL, Oracle, and MS SQL Server. Even though some of those are expensive commercial products, you can get free evaluation copies for learning purposes to run on your own machine.

O. Jones
  • 103,626
  • 17
  • 118
  • 172
1

MySQL is the old database driver, and MySQLi is the Improved driver. MySQLi takes advantage of the newer features.

Advantages :

  • Object-oriented interface
  • Support for Prepared Statements
  • Support for Multiple Statements
  • Support for Transactions Enhanced debugging
  • capabilities Embedded server support

You have the choice of using mysql, mysqli, or PDO essentially.

Mimouni
  • 3,564
  • 3
  • 28
  • 37
-1

just change mysql to mysqli and you should be good to go. Mysqli is an upgrade to mysql

with mysqli the user has the ability to utilize new features available in the newest versions of MySQL servers. This is one of the biggest advantages of MySQLi. Other platforms are unable to take full advantage of MySQL’s newest capabilities. there are cons though, unlike PDO MySQLi only works with MySQL databases, PDO is more flexible and able to work with multiple database systems, including IBM, Oracle and MySQL. If you have to switch databases, MySQLi is not the best option.

user3487121
  • 59
  • 1
  • 1
  • 11
  • 1
    Expand on the answer, e.g. what "changes" are required? And what is the difference between mysql_ and mysqli_ *anyway*? – user2864740 Oct 25 '14 at 20:44
  • Put that up in the answer! :) Also, what new features/support does mysqli_ allow? Answers should be specific, not a general product brochure. – user2864740 Oct 25 '14 at 20:56
  • MySQLi’s interface is similar to the older MySQL interface. This versatility in using both object-oriented and procedural formats makes it easier for users of the older system to make the change to the improved one, as well as facilitating use for people that are completely new to the system. Using the old system, the user would enter a function looking like this: `mysql_connect()`, using the new system, this old code can be updated simply by changing the function to this: `mysqli_connect()` – user3487121 Oct 25 '14 at 21:03