Page 1 of 1
Problem need help Urgently...
Posted: Mon Apr 11, 2011 1:11 pm
by shinstar
Helloo ever one i need know In PHP the function giving the current time stamp value is time(). So we can write a line like below to get the current time stamp value.
<? echo time(); ?>
my Question is how to display any value on specific time( where value is stored in database )...
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 1:34 pm
by fugix
you could set up an if function using the time() or now() function with a specific format and set it equal to the time that you want to show the data (using the same format as in the time() function)
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 1:48 pm
by shinstar
Thanks for reply but , what will i do if i want to show data like this format,
e.g Time Value
10:00 am ( value here from database which is saved before )
10:30 am ( value here from database which is saved before ) and so on....please guide me thanks
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 2:09 pm
by fugix
Code: Select all
if (time($format)==10:00am) {
echo "10:00am(" . $database_info . ")";
}
are you talking about something like that?
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 2:14 pm
by shinstar
yes this is it but ,
i just want to display some value which is stored before on a specific time of server, e.g
if server current time is,
10:00 am ( then display my value which is stored before)
when time goes to ,
10:30 am ( then display next value which is stored before)
this process is continued till the values stored in the data base is finished..
hope you understand...
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 2:37 pm
by fugix
then you would put the if function into a while loop
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 2:44 pm
by shinstar
ok thanks but tell me in code
if (time($format)==10:00am) {
echo "10:00am(" . $database_info . ")";
}
what is $database_info come from?
i just want to display the values form database which i have saved before in table and just want to be displayed when specific time comes as i told above in e.g
if i have stored some thing like value let say ( 10,20,30,40 and so on ) in database
now i just want a php code to display it on site but on specific time only like this,
if time = 10:00am display value = 10
when time = 10:30am display value = 20
when time = 11:00am display value = 30
and so own simple...
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 2:47 pm
by fugix
$database_info is whatever info that you want to be shown...you would name that variable whatever you want.
while(time($format)==10:00am) {
//code
}
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 2:55 pm
by shinstar
ok what should i do if i want to display the record like this with data and time both,
database value is 10,20,30,40
Site output should be like this let say,
date-------------------time-------------------value
12-04-11--------------3:00 pm---------------10
12-04-11--------------3:30 pm---------------20
12-04-11--------------4:00 pm---------------30
12-04-11--------------4:30 pm---------------40
give me code thanks with comments
Re: Problem need help Urgently...
Posted: Mon Apr 11, 2011 3:12 pm
by fugix
why are you trying to do things like this when you have clearly not learned enough? walk before you can run my friend. take some time to learn alot about PHP before trying to do things you do not understand.