S.O.S
| From: | emine hacioglu | Date: | Mon, 04 Sep 2000 10:28:58 +0000 |
| Subject: | S.O.S | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-231@lists.php.net to get a copy of this message | ||
Hello!! I am from Turkey;
I have a piece of PHP code that prints the information
on the screen which is pulled from the MySQL database.
You can see it www.cdkent.com/index.php3
You can see a part of page calledn "Bu Haftakiler" (right
in the middle of the page). That part will be updated everyday
using the data from database.
Here's my question:
The current system prints the data in the database
but what I want is: e.g. I entered 30 piece of data
into the database and I want my system to choose 3
random entry and print them (not all of them).
And after printing 3 random entries, I want my system
to update the page every 5 seconds and again print 3 random
entries.
Thanks in advance.
<html>
<head>
<title>Detay</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
</head>
<body topmargin="0" leftmargin="0">
<?php
$bugun = date ("jm");
mysql_connect (localhost);
mysql_select_db (cdkent);
$result = mysql_query ("SELECT * FROM haber where tarih = $bugun" );
if ($myrow = mysql_fetch_array($result)) {
do {
printf ("<table border=1><tr><td>");
printf ("<a href=http://localhost/htdocs/deneme2.php3?kod=%s><img src=http://localhost/htdocs/resim/%s.jpg border=1 width=70 height=70></a>",$myrow["kod"], $myrow["kod"]);
printf ("</td><tr></td><td width=100><font size=4 face=Verdana>%s</font>",$myrow["header"]);
printf ("</td><tr></td><td width=120><font size=2 face=Verdana>%s</font>",$myrow["text"]);
printf ("</tr></table>");
}
while ($myrow = mysql_fetch_array($result));
}
else { echo "kayit bitti"; }
?>
</td>
</tr>
</table>
</body>
</html>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at http://profiles.msn.com.