phpbuddy.eu
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 06.08.2003, 13:06   #1
TP-Junior
 
Registriert seit: Apr 2003
foobar macht alles soweit korrekt

SQL Fehler


Hallo!

ICh bastel zur zeit an einem skript das mit einem MSSQL Server zusammenarbeiten muss. ich arbeite in der regel mit mysql. allerdings gibt das keine probleme da da syntax usw. gleich sind. allerdings habe ich einen fehler...
ich will aus der datenbank auslesen ob ein user exitiert. soweit so gut ist mir auch alles klar..
allerdings liest er mir das ganze nicht aus und irgendwie weiß ich nicht warum...

das einzige was noch ist die abfrage "$REMOTE_USER" ergibt einen usernamen nach dem muster "XXX\nachname.vorname". Kann es sein dass ich dann das \ escapen mus oder wo is mein fehler?

ich bin verzweifelt.. nachfolgend der source

PHP-Code:
<?php
include("includes/mssql.php");

mssql_select_db($mssql_db$mssql);
$sql "SELECT user_loginname FROM nis_user WHERE user_loginname = '".$REMOTE_USER."'";
echo 
"<br>";
$resultmssql_query($sql$mssql);
$num mssql_num_rows($sql);

echo 
$num;
?>

Geändert von foobar (06.08.2003 um 13:15 Uhr).
foobar ist offline   Mit Zitat antworten


Alt 06.08.2003, 13:13   #2
TP-Veteran
 
Benutzerbild von Flow09
 
Registriert seit: Jun 2001
Ort: Wien
Flow09 ist auf einem guten Weg
1.) Was bekommst Du den für einen Fehler ausgespuckt??

2.) Laß Dir den SQL-String per echo mal ausgeben und schau ob er auch korrekt zusammegefügt ist!

lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
Flow09 ist offline   Mit Zitat antworten
Alt 06.08.2003, 13:14   #3
TP-Junior
 
Registriert seit: Apr 2003
foobar macht alles soweit korrekt
SELECT user_loginname FROM nis_user WHERE user_loginname = 'XXX\Nachname.Vorname'
Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in ZENSIERTER SERVER

das hab ich beides gemacht wie oben zu sehen ist...
auch schon vorher...
foobar ist offline   Mit Zitat antworten
Alt 06.08.2003, 13:27   #4
TP-Veteran
 
Benutzerbild von pauel
 
Registriert seit: Jan 2003
Ort: München
pauel hilft, wo's gehtpauel hilft, wo's geht
manamanman:

im Querie OR DIE (msql_error ())

dann siehst du was du für nen SQL fehler hast!
pauel ist offline   Mit Zitat antworten
Alt 06.08.2003, 13:29   #5
TP-Junior
 
Registriert seit: Apr 2003
foobar macht alles soweit korrekt
ach ne?

Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in SERVER on line 8


is immer noch der gleiche..
foobar ist offline   Mit Zitat antworten
Alt 06.08.2003, 14:02   #6
TP-Veteran
 
Benutzerbild von Flow09
 
Registriert seit: Jun 2001
Ort: Wien
Flow09 ist auf einem guten Weg
Ahh, gefunden!!

Das wird so nicht funktionieren:
Zitat:
$sql = "SELECT user_loginname FROM nis_user WHERE user_loginname = '".$REMOTE_USER."'";
echo "<br>";
$result= mssql_query($sql, $mssql);
$num = mssql_num_rows($sql);
Wenn dann nur mit:
PHP-Code:
$num mssql_num_rows($result); 
Wenn Du mssql_num_rows() den SQL-String übergibst wird es damit nicht viel anfangen, mußt schon das Resultset ($result) hergeben!!

lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
Flow09 ist offline   Mit Zitat antworten
Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > Traum-Dynamik
SQL Fehler SQL Fehler
« Hilfe wer findet den Fehler??? | double in time umwandeln »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 22:30 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67