Jump to content

duchaine1

New Members
  • Posts

    2
  • Joined

  • Last visited

duchaine1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I need to ask if there are any errors in this code? Also, where should this be uploaded to in file mgr.? (page name is connect.php) <?php $servername = "localhost"; $username = "itisok"; $password = "pwisok"; // Create connection $conn = mysqli_connect($servername, $username, $password;) // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } echo "Connected successfully"; ?> <html> <head> </head> <body> <h1>PHP connect to MySQL</h1> </body> </html> Thanks, LD
  2. Hi, Being somewhat new to the subject I ALREADY have the connection code to database, what I need is WHERE to place it. In other words where do I put THIS... <?php $conn = mysqli_connect( <location-of-your-database>, <your-MySQL database-username>, '<your-MySQL-database-password>, and so on. It is all done and ready to go. So, do I put it in index.html, no good, DB error so where does it go? Also is it a <PHP> page? Surprisingly this is hard to find. Everybody talks in detail about the script, but NOBODY mentions where it is placed! Thanks! Duchaine (du shane)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.