Display data function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shinstar
Forum Newbie
Posts: 18
Joined: Fri May 21, 2010 2:33 pm

Display data function

Post by shinstar »

This is the php code i have wrote but i need some help....as this code is displaying my value from database when time(which is saved in database too) is equal to current server time.
let say e.g : time saved in database is 6:00:00,
so when current time is equal to database time which is 6:00:00
it then display my stored value(e.g 40 (int) ) from database. which is : 40
so i need help out here when the value shows : 40 on exact 6:00:00 (time) but disappear after a second i want to be display this value for 30 more sec.after that a new value from database will come and diplay as the time goes to 6:00:30
hope friend you will help me out soon thank you below is the code of php file.


// First Connect to database
echo "<meta http-equiv='refresh' content='20'>";

$link = mysql_connect("$dbhost","$dbuser","$dbpass") or die(mysql_error()); // Connection starts here
mysql_select_db("$dbname") or die(mysql_error());
$sql = "SELECT * FROM datatable WHERE time = '$ctime' "; // simple sql example

echo $cdate;
echo "<br>";
echo $ctime;
$re = mysql_query($sql) or die(mysql_error()); // Here's where you'll get an error if the SQL is invalid.
while($row = mysql_fetch_array($re))
{ // Beganing 1
include("variables.php");

echo "<br>";
echo $row['value']; [size=14pt]// value to be displayed for 30Sec after displayed on site.[/size]

} //Closing 4


mysql_close($link);


// code ends here..:-)
incubi
Forum Contributor
Posts: 119
Joined: Mon Dec 07, 2009 1:47 pm

Re: Display data function

Post by incubi »

I see no one has tried to help so I'll give it a go. When you say "it displays for a second then disappears" why is that? Are you running the script again one second later?

Lee
Post Reply