Welcome Guest, Not a member yet? Register   Sign In
All Builder DB queries fail after server move
#1

Hi,
I have CI4 installed on a hosted server with 2 databases. The installation is on a sub-domain. This has been running very well for over 1 year.

I have a need to provide spearate system on a different sub-domain (using same databases) for demonstration purposes. I want to keep 2 entirely separate systems so i can continue develop while demo/testing can take place on the 2nd.

After successfully configuring the new subdomain on the hosted server, I copied all CI4 files and folders from the woking sub-domain to the new sub-domain.

I have updated the app/config/app.php baseURL

However, Builder DB will NOT work!

I know my Model is correct (it's an exact copy of  sub-domain 1) but the following query now generates an error on the new sub-domain: mysqli_sql_exception #1064 - You have an error in your SQL syntax;

PHP Code:
public function getUsers ($vals) {
    return $this->where('email'$vals)
    ->find();


However if I substitute the above with the following (essentially the same query) I don't get any error

PHP Code:
public function getUsers ($vals) {
     $sql="SELECT * FROM table WHERE email='".$vals."'";
     try {
         $query $this->query($sql);
         $row $query->getResultArray();
         return $row;
     }catch(\Exception $e) {
         return false;
     }
 } 

And, if I continue thrugh my script, every builder type function fails, while a longhand version of the same query works fine!!

Does anyone have any idea why?

Thank you.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB