0

Previously I had a Linux hosting package for my website and had the following code

$selectUsersStmt = $connection->prepare("SELECT firstName FROM users WHERE email = ?");
$selectUsersStmt->bind_param('s', $email);
$selectUsersStmt->execute();
$result = $selectUsersStmt->get_result();

It worked fine on the Linux hosting but since switching to CPanel it is now giving a commands out of sync error after the 3rd line.

Is there something in the way I need to prepare my statements that is different with CPanel vs Linux?

a.cayzer
  • 289
  • 4
  • 22
  • 1
    What code have you got before this? This doesn't look possible. Maybe you have it configured to use libmysqlclient instead. Check your CPanel if you have mysqli_nd enabled – Dharman Sep 04 '21 at 20:36
  • I have a require file which is creating the $connection variable. I know this is working as other queries are fine with the same require. In terms of mysqli_nd I can see the following are ticked in CPanel (mysqli and mysqlind) however nd_mysqli is not ticked. Is that how it should be? – a.cayzer Sep 04 '21 at 20:51
  • I have unticked mysqli and now have both mysqlind and nd_mysqli ticked and the code is working again!! Thank you @Dharman. If you want to post that as the answer I will mark as correct. Thank you so much – a.cayzer Sep 04 '21 at 20:56
  • Sorry, I meant nd_mysqli. I added proper answer now. – Dharman Sep 04 '21 at 22:24

0 Answers0