Nieuw lid |
|
ik gebruik volgende script voor het zoeken van records volgens een letter van alfabet. Maar hoe kan ik een *.gif plaatje koppelen aan een record indien record nieuw is of een update. De plaatjes moeten dan een bepaalde periode zichtbaar zijn, of wel nieuw of wel update. De plaatjes liggen in $Image_folder="./updateNew/";
<?php
$Search = $_GET['q'] ;
// Connecting, CHANGE: servername, username and password
$Connection = mysql_connect(.....) or die("Could not connect to database server");
// Selecting database, CHANGE: databasename
mysql_select_db("") or die("Could not select database");
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
print "<HTML>\n";
$QueryString1 = "SELECT * FROM dog_table WHERE DogName REGEXP '^$Search' ORDER BY DogName ASC";
//$QueryString = "SELECT RTRIM(DGName) AS Name FROM dog_table WHERE DogName REGEXP '^[^$Search.*'";
$result = mysql_query($QueryString1) or die("Syntax error pedigree.php (Query 1)");
$num_rows = mysql_num_rows($result);
//print "number of rows = $num_rows\n";
while($row = mysql_fetch_array($result,MYSQL_BOTH)){
$field=$row['DogName'];
$id=$row['Id'];
print "<a href=./pedigree.php?Id=$id"."&"."Gen=4>$field</a><br>";
}
mysql_free_result($result);
print "<HEAD>\n";
print "<TITLE>$Name</TITLE>\n";
print "<META name=\"Description\" content=\"$DGRegNam\">\n";
print "<META name=\"Keywords\" content=\"$DGRegNam\">\n";
print "</HEAD>\n";
print "<BODY>\n";
//print "search for letter $Search<br>";
print "</BODY>\n";
?>
<?php $Search = $_GET['q'] ; // Connecting, CHANGE: servername, username and password $Connection = mysql_connect(.....) or die("Could not connect to database server"); // Selecting database, CHANGE: databasename print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"; $QueryString1 = "SELECT * FROM dog_table WHERE DogName REGEXP '^$Search' ORDER BY DogName ASC"; //$QueryString = "SELECT RTRIM(DGName) AS Name FROM dog_table WHERE DogName REGEXP '^[^$Search.*'"; $result = mysql_query($QueryString1) or die("Syntax error pedigree.php (Query 1)"); //print "number of rows = $num_rows\n"; $field=$row['DogName']; $id=$row['Id']; print "<a href=./pedigree.php?Id=$id"."&"."Gen=4>$field</a><br>"; } print "<TITLE>$Name</TITLE>\n"; print "<META name=\"Description\" content=\"$DGRegNam\">\n"; print "<META name=\"Keywords\" content=\"$DGRegNam\">\n"; //print "search for letter $Search<br>"; ?>
Misschien met strtotime()
En hoe implementeer ik die in het script.
Ik hoop dat ik duidelijk was in mijn uitleg.;-)
|