Einzelnen Beitrag anzeigen

Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#16

Re: IF NOT EXIST abfrage mit MySQL

  Alt 2. Feb 2009, 13:13
Wie soll ich das denn abfragen ob 0 kommt?

$usernotexists = <<<MEHRZEILEN
mysql_query("SELECT COUNT(*) AS Anzahl
FROM Tabelle
WHERE username = $botname")
MEHRZEILEN;

if ($usernotexists == 0)
{
mysql_query("INSERT INTO Tabelle(Feldliste) VALUES(Wertliste)");
}


Und noch eine Frage:
mysql_query("SELECT COUNT(*) AS Welche anzahl?
FROM Tabelle
WHERE username = $botname")
Milos
  Mit Zitat antworten Zitat