Welcome Guest, Not a member yet? Register   Sign In
is not valid mysql resource displayed online but not locally
#1

[eluser]WebMada[/eluser]
Hello!

I use WAMP to test locally my website and it works correctly
But online, I got the following error message but the insertion is always done unless that
Quote:Severity: Warning
Message: mysql_errno(): 33 is not a valid MySQL-Link resource
Filename: mysql/mysql_driver.php
Line Number: 399

I search solutions on the net but no convincing solutions before posting this subject here.

I post you the part of the code of my controller which causes this message:
Code:
$this->load->model("utilisateur");
            $objUtilisateur = $this->utilisateur->GetById($_POST["livre"]["IdUtilisateur"]);
            if (! empty($objUtilisateur->Login)) {
                if (!empty($_POST["Password"])) {
                    $objUtilisateur->Login = $_POST["livre"]["Email"];
                    $objUtilisateur->Password = $_POST["Password"];
                    $objUtilisateur = $this->utilisateur->Update($objUtilisateur);
                }
            } elseif(! empty($_POST["livre"]["Email"]) and ! empty($_POST["Password"])) {
                $objUtilisateur->Login = $_POST["livre"]["Email"];
                $objUtilisateur->Password = $_POST["Password"];
                $objUtilisateur = $this->utilisateur->Insert($objUtilisateur);
                $_POST["livre"]["IdUtilisateur"] = $objUtilisateur->IdUtilisateur;
            }

            if (!empty($_FILES["txtFichierFichierCV"]["name"])) {
                $Extension = end(explode(".", $_POST["livre"]["FichierCV"]));
                if (UploadRename($_POST["livre"]["FichierCV"], $objUtilisateur->Login)) {
                    $_POST["livre"]["FichierCV"] = $objUtilisateur->Login . "." . $Extension;
                }
            }

            $_POST["livre"]["ActivationKey"] = uniqid();
            $this->livre->Update($_POST["livre"]);
#2

[eluser]techgnome[/eluser]
Did you change the database configuration before uploading it?

-tg
#3

[eluser]WebMada[/eluser]
No, I didn't, why?
#4

[eluser]keithics[/eluser]
check the spelling and capitalization in your database config.
#5

[eluser]WebMada[/eluser]
[quote author="fivel" date="1291240429"]check the spelling and capitalization in your database config.[/quote]
Can you explain more please?
#6

[eluser]BigDon[/eluser]
[quote author="WebMada" date="1292937423"][quote author="fivel" date="1291240429"]check the spelling and capitalization in your database config.[/quote]
Can you explain more please?[/quote]

I believe what he is trying to say is that the lines in your database config file was something like:

Code:
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "myDataBase";

and now that you have moved to your host, the 'hostname' should be changed to the one reflected by phpMyadmin on your host and the 'database' value should also be changed to how it is shown in your host control panel. For example:

Code:
$db['default']['hostname'] = "newsite_localhost";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "newsite_db_myDataBase";

Hope this helps.
#7

[eluser]WebMada[/eluser]
OK! So, I have no problem in the database configuration

I repeat the scenario: the code is in my 1st message, I just got this error message but the Update() works




Theme © iAndrew 2016 - Forum software by © MyBB