Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 119881

Re: Converting to MYSQLI

$
0
0

I solved this by putting my connection include in a function called dbconnect()

Then I injected the function for the connection handle..

Like so

$theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string(dbconnect(), $theValue) : mysqli_escape_string(dbconnect(), $theValue);

 

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "''";

      break;   

 

*****************

Connection php file

<?php

function dbconnect()

{

  $hostname_PrintSchedDataCn = 'localhost';

  $database_PrintSchedDataCn = 'nothing';

  $username_PrintSchedDataCn = 'nothing';

  $password_PrintSchedDataCn = 'nothing';

  $PrintSchedDataCn = mysqli_connect($hostname_PrintSchedDataCn, $username_PrintSchedDataCn, $password_PrintSchedDataCn, $database_PrintSchedDataCn) or trigger_error(mysqli_error(),E_USER_ERROR);

  return $PrintSchedDataCn;

}

?>


Viewing all articles
Browse latest Browse all 119881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>