Rouven: SQL: Überpfüfen ob ein Eintrag schon vorhanden ist...

Beitrag lesen

Hallo,

schau dir bitte mal an, was die Rückgabe von mysql_query ist: Ein Result-Handle (oder false falls die Abfrage fehlgeschlagen ist).
Du könntest z.B. im Anschluss an die Abfrage mittels mysql_num_rows prüfen, ob du Treffer gefunden hast. Oder du machst ein SELECT COUNT(*) FROM... und liest nach der Abfrage den ersten Wert aus. Steht 0 drin wurden keine Treffer gefunden, ansonsten halt so viele wie da drin stehen.

MfG
Rouven

--
-------------------
He is entertaining both out of the car and in the car because if you tell him that a corner is almost flat then he is the guy who is going to try to take it flat even if it means shunting it the other side of it, he will come with the data and say 'hey, I may have crashed and destroyed the car, but I was flat-out'. That is an interesting quality that he has!  --  Team Member on Jacques Villeneuve