mardi 20 avril 2021

laravel sqlsrv db connection works but db::select not working

i want to connect database with sqlsrv, it works connection but query is not working , i tried this command

if(DB::connection()->getDatabaseName())
            {
               echo "Yes! successfully connected to the DB: " . DB::connection()->getDatabaseName();
            } else {
                echo "not connected";
            }


$loginData = DB::select("exec appLogin @userName = '".$request->email."', @password  = '".$request->password."'");
        $loginData = DB::select("select * from [User]");
        echo '<pre>';
        print_r($loginData);
        die;

for that i am getting success response for database connection, but when i tried DB:select command i am getting this error

[Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: No connection could be made because the target machine actively refused it.


    


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire