ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.29k stars 1.35k forks source link

able to insert data on local machine but not on server(ubuntu) #958

Closed CherukuriSiva closed 3 years ago

CherukuriSiva commented 3 years ago

First of all, thank you for open sourcing this great library.

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $data_to_store = array("created_at" => date('Y-m-d H:i:s'),
            "status" => 'pending',
            "is_active" => 'false',
            "full_name" => xss_clean($_POST['full_name']),
            "email" => xss_clean($_POST['email']),
            "phone" => xss_clean($_POST['phone']),
            "city" => xss_clean($_POST['city']),
            "height" => xss_clean($_POST['height']),
            "weight" => xss_clean($_POST['weight']),
            "age" => xss_clean($_POST['age']),
            "eyes" => xss_clean($_POST['eyes']),
            "hair" => xss_clean($_POST['hair']),
            "dress" => xss_clean($_POST['dress']),
            "bust" => xss_clean($_POST['bust']),
            "waist" => xss_clean($_POST['waist']),
            "hips" => xss_clean($_POST['hips']),
            "gender" => xss_clean($_POST['gender']),
            "shoes" => xss_clean($_POST['shoes']),
            "message" => xss_clean($_POST['message'])

        );

      print_r($data_to_store);
        $last_id = $db->insert('models', $data_to_store);
}

I am able to insert data using the above code in my local machine's mysql without any issues. However same code not working on the host machine.

I have followed the steps mentioned in the below link and installed apache and mysql. https://bmtechtips.com/how-to-launch-your-own-php-website-on-a-digitalocean.htm

In my local machine PHP version is: PHP 8.0.2 The server machine's PHP version is: PHP 7.4.3

Could you please help me to resolve this issue.

igorek24 commented 3 years ago

What version php is on your 'host machine.'?

CherukuriSiva commented 3 years ago

It was a file upload size issue. Localhost is accepting even 10MB images but the server machine has some restrictions on image sizes. I updated the php.ini file then found no issues.