PHP: Changing mysqli connection to use SSL

Damonc

Damon
Thread Starter
Joined
May 9, 2001
Messages
670
Hi,

While it may not be best practice, I've got a few variants of the code below several times through an internal web-application we use in the office. However I want to change it to use SSL, the database side is ready to accept the SSL, I just need to find a way (hopefully) to do a find and replace to add the SSL component.

is there any way of easily modifying the below?

PHP:
$connection = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($connection, "$db_name")or die("cannot select DB");
$sql="SELECT * FROM `$tbl_name` WHERE field = '$criteria'";
$result=mysqli_query($connection, $sql);
Thanks in advance.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top