By 03/02/2016 9 Comments

Can MySQL APIs to be mixed in PHP?

Example-1:

$con=mysqli_connect("localhost", "root" ,"" ,"mysql");

if( mysqli_connect_errno( $con ) ) {
    echo "failed to connect";
}else{
    echo "connected";
}
mysql_close($con); // note this line
echo "Done";

Example-2:

$con=mysql_connect("localhost", "root" ,"" ,"mysql");
if( mysqli_connect_errno( $con ) ) {
    echo "failed to connect";
}else{
    echo "connected";
}
mysqli_close($con); // note this line
echo "Done";


REMEMBER:

  • No, Mysql and Mysqli can not be used together. They are separate APIs and the resources they create are incompatible with one another, so the above both examples are invalid.
  • Remember Mysql extension is also deprecated in php5 and above.






Posted in: PHP, Solutions

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .