Skip to main content

Posts

Showing posts from August, 2016

How to Connect To Your Database Using PHP and MySQLi

Connecting your project to SQL Database comes with these 3 requirements. 1. Create 2 Pages (Optional tho' but safe) with these names: config.php connect.php Reasons, If A hacker, hacks to your connect page, he'll get all there is to know about your script and your database and that might be really harmful but if, there's a configuration with secret details and a connection with configured details separately created there's actually a sense of safety. In the first  config.php Type these codes <?php  define("DATABASE_HOST","localhost"); define("DATABASE_USER","root"); define("DATABASE_NAME","test_name"); define("DATABASE_CODE","");  ?>   DATABASE_HOST This Database_host is by default a "localhost" since it is a test work done locally, using *AMP (APACHE,  MYSQL, & PHP). DATABASE_USER   The database user is by default "root" but can be alt