Phorum.ro
Your Avatar Welcome to Phorum.ro!
If you haven't registered yet, click here!
Attention Visitor:
You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Du-te înapoi   Phorum.ro > Web Design & Web Development > Programare > PHP > Discutii Generale

Discutii Generale Discutii generale despre PHP.

Răspunde
 
Thread Tools Moduri de afișare
Vechi 25.01.2009   #1
Husse
8-Bit Member
 
Data înregistrării: 06.07.2007
Mesaje: 3
Rep Power: 5
Husse is on a distinguished road
Implicit Functie time

Se dau urmatoarele
O tabela "towns" si o coloata de tip datetime numita "Creare" care inregistreaza data(yyyy-mm-dd) creerii orasului cu ajutorul functiei now(),

Eu trebuie vreau sa compar data creeri orasului cu daca curenta a servarului sa vad daca Diferenta este mai mare de 10 zile.
Am incercat astfe:

Am creeat o functie:
Cod:
function date_diff()
{
 global $db_id;

 $query="SELECT * FROM towns WHERE DATE_SUB(CURDATE(),INTERVAL 10 DAY)"; 
 $diferenta=mysql_query($query, $db_id);
 return $diferenta;
}

if $diferenta > 10 zile {ataca} else {orasul are imunitate}
Dar bine inteles ca nu a mers . Ce ar trebui sa fac?
__________________
http://www.mxsoft.ro/forum
Husse is offline   Reply With Quote
Sponsored Links
Răspunde


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Moduri de afișare

Reguli de postare
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Pornit
emoticoanele sunt Pornit
Codul [IMG] este Pornit
Codul HTML este Pornit



Ora este GMT +3. Ora este acum 01:10:59.


Rulează cu: vBulletin Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum SEO by Zoints

XXXXXXXXXXXXXXXXXXX
Inactive Reminders By Icora Web Design