22. februar 2004 - 22:28Der er
10 kommentarer og 1 løsning
Sammenligne Timestamp med Current_Timestamp
Er ved at lave et billetsystem hvor det skal være muligt at bestille billetter indtil en time før forestillingen starter. Havde tænkt, at det smartest kunne gøres ved at sammenligne forestillingens timestamp med current_timestamp men hvordan??
$forestillinger = mysql_query("SELECT Forestilling.ID, Tid, Titel, Gruppe, Spillested FROM Forestilling, Titel, Gruppe, Spillested WHERE TitelID=Titel.ID AND GruppeID=Gruppe.ID AND SpillestedID=Spillested.ID");
while ($forestilling = mysql_fetch_array($forestillinger)) { $id = $forestilling["ID"]; $tid = $forestilling["Tid"]; $titel = $forestilling["Titel"]; $gruppe = $forestilling["Gruppe"]; $spillested = $forestilling["Spillested"]; echo("$tid $titel $gruppe $spillested"); echo("<a href='bestil.php?id=$id'>Bestil billet</a>"); } //Det sidste ekko skal så styres af
//istedet for $now = time() har jeg sat $now = ( date("Y-m-d H:i:s")); //for at kunne sammenligne $timestamp = $tid; //min $tid variabel er gemt i MYSQL databasen som DATETIME Endnu engang tak for din hjælp :)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.