1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Hier Titel eintragen</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$sqlhost = "localhost";
$sqluser = "nela";
$sqlpassword = "-----";
$sqldb = "nela";
mysql_connect($sqlhost,$sqluser,$sqlpassword) or die ("Keine Verbindung möglich"); mysql_select_db($sqldb) or die ("Die Datenbank existiert nicht");
$sql = "SELECT * FROM Pferd";
$result = mysql_query($sql) OR die(mysql_error());
while ($row=mysql_fetch_array($result) ) {
$id = $row['id'];
$jahre = $row['jahre'];
$neu = $jahre + 1;
$sql = "UPDATE `Pferd` SET `alter` = `alter` + 1";
mysql_query($sql);
}
?>
</body>
</html> |