I am upgrading to PDO from MySQLi

by John Martin   Last Updated September 23, 2017 03:05 AM

This is what I have currently in MySQLi.

$getsettings = mysqli_query($con, "SELECT * FROM `settings` LIMIT 1") or die(mysqli_error($con));

while($row = mysqli_fetch_assoc($getsettings)) {
$homepage_slider1 = $row['title_1'];
$sub1_1 = $row['sub1_1'];
$sub2_1 = $row['sub2_1'];

$homepage_slider2 = $row['title_2'];
$sub1_2 = $row['sub1_2'];
$sub2_2 = $row['sub2_2'];

$homepage_slider3 = $row['title_3'];
$sub1_3 = $row['sub1_3'];
$sub2_3 = $row['sub2_3'];

$oneweek = $row['oneweek'];
$twoweek = $row['twoweek'];
$fourweek = $row['fourweek'];

$xblsname = $row['name']; //Server name
$downloadxex = $row['downloadxex'];


I want to make a PDO version with this, but having issues, how do I do it? I tried over at some other site, but it looks like they don't understand simple English when it comes to someone who is having a hard time with coding. Instead of trying to help they just vote the question out and complain. I would appreciate it if someone would help here, I've tried several things and I have a lot of pages which use the VARS from this settings.php and getting this working as the MySQLi example about would save me a whole bunch of time. I have already got the connection set up with PDO syntax and it is working as I have confirmed as I have my Session login working with it. Thanks in Advanced.

Tags : php mysql

Related Questions

Is this a race condition?

Updated April 16, 2015 20:02 PM

problem in show threads 1 result mysql.php

Updated May 28, 2015 22:02 PM