php - XAMPP won't connect to my database -


i want test codes using xampp keep getting no database selected though right, ideas why won't connect database? have encountered warning on several occasions want test of codes using xampp. warning: deprecated: mysql extension deprecated , removed in future: use mysqli or pdo instead

<?php //this works mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("testdb") or die(mysql_error()); ?>   <?php  $con=mysqli_connect("localhost","root","","testdb");  if (!$con) { die("connection error: " . mysqli_connect_error()); } ?>  

returns this: no database selected


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -