ich bin derzeit nen bissel mit SP's am rumhantieren. Als Server verwend ich den MS SQL Server 2008.
Was ich vor hatte: Das Login via Prozedur checken die einen rückgabewert liefert den ich dann im Script weiter auswerten kann.
SQL der SP:
Code:
/****** Object: StoredProcedure [dbo].[usp_login] Script Date: 04/13/2014 13:44:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[usp_login]
@role varchar(30),
@password varchar(50),
@ip varchar(20),
@state nvarchar OUTPUT
as
SELECT
@state = COUNT(*) FROM dbo.ROLE_TBL
WHERE
role = @role AND password = @password
GO
Mein PHP Code enthält noch die IP des Benutzers, jedoch muss ich ja erst mal das eigentliche Login an sich zum Laufen bringen bevor ich etwas loggen kann. Die Prozedur gibt mir in meinen Managment Studio für das Output Field 1 oder 0 aus, also klappt die obrige Prozedur jedoch erhalte ich in PHP immer bei nen dump int(0) und errors werden mir auch nicht zurück gegeben.
PHP Code:
PHP Code:
public function chkLogin($role, $password) {
// Datenbank auf WEBSIT_DBF ändern
sqlsrv_query($this->db, "USE WEBSITE_DBF;");
// Von der Prozedur den Output Wert zurückgeben.
return $output;
}
Ich arbeite erst seit kruzen mit den sqlsrv_ treibern und mit Prozeduren, kA ob ich irgendwo einen gravierenden Fehler habe, aber laut Dokumentation ist das so richtig.
lg und danke im vorraus für jede hilfe / jeden tipp.
Im Code an sich war kein Fehler.
Die Prozedur war bissl komisch, mit nen Erzwingen ( T-sql Befehl RETURN ) des Anweisungsblock klappt nu alles, trotzdem danke Shawak
[RELEASE] SQLsrv PHP Tester 03/11/2014 - Dekaron Private Server - 4 Replies This script can test your mssql connection and check if you have sqlsrv installed on php
Just edit this file ("sqlsrv_test.php") and upload to your server you want to check!
Have fun, and DONT forget to say Thanks!
[ADVANCED] Registration Script / SQLSRV 01/06/2014 - Rappelz Private Server - 30 Replies -- Forewarning --
The following is in no way shape or form intended for the use of beginners and requires basic and intermediate skill levels to apply and use.
-- Features --
Username Check
Password Confirm
Password MD5 Encryption
Age Field (For Server using; Adult Server)
[RELEASE] SQLSRV Password Changer 11/26/2012 - Rappelz Private Server - 8 Replies Warnings!
This script will only function with the following requirements met:
PHP 5.3+
SQLSRV api e.g PHP Driver 3.0+
Properly configured IIS 7.5+
Basic Knowledge of HTML/PHP
I will not be answering any questions and anything posted here-in will be provided on an as-is basis with the knowledge that you may have to make adaptations to the script to suit your specific needs.
[RELEASE] Simple SQLSRV Registration 11/26/2012 - Rappelz Private Server - 4 Replies Warnings!
This script will only function with the following requirements met:
PHP 5.3+
SQLSRV api e.g PHP Driver 3.0+
Properly configured IIS 7.5+
Basic Knowledge of HTML/PHP
I will not be answering any questions and anything posted here-in will be provided on an as-is basis with the knowledge that you may have to make adaptations to the script to suit your specific needs.
[RELEASE]: SQLSRV Rappelz Website... 06/11/2012 - Rappelz Private Server - 1 Replies Thanks to the FUNENTRY team for releasing the previuos version of this web site, here you can find its sqlsrv version...
Microsoft SQLSRV TechNote
Since mssql is going to be deprecated... enjoy this.
With regards,
Ska...