![]() |
|
|||||||||
|
|||||||||
|
| 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. |
|
||||||
| Discutii Generale Discutii generale despre PHP. |
![]() |
|
|
Thread Tools | Moduri de afișare |
|
|
#1 |
|
8-Bit Member
Data înregistrării: 06.07.2007
Mesaje: 3
Rep Power: 5 ![]() |
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}
__________________
http://www.mxsoft.ro/forum |
|
|
|
| Sponsored Links |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Moduri de afișare | |
|
|