Her er hele koden som jeg bruger fordi jeg forstår ikke helt dit spørgsmål
<?php require_once('Connections/database.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_database, $database);
$query_Recordset1 = "SELECT * FROM spillesteder";
$Recordset1 = mysql_query($query_Recordset1, $database) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
mysql_select_db($database_database, $database);
$query_Recordset2 = "SELECT * FROM maskiner";
$Recordset2 = mysql_query($query_Recordset2, $database) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$colname_steder = "-1";
if (isset($_GET['navn'])) {
$colname_steder = $_GET['navn'];
}
mysql_select_db($database_database, $database);
$query_steder = sprintf("SELECT * FROM spillesteder WHERE navn = %s", GetSQLValueString($colname_steder, "text"));
$steder = mysql_query($query_steder, $database) or die(mysql_error());
$row_steder = mysql_fetch_assoc($steder);
$totalRows_steder = mysql_num_rows($steder);
mysql_select_db($database_database, $database);
$query_Recordset3 = "SELECT * FROM maskinenoter";
$Recordset3 = mysql_query($query_Recordset3, $database) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
$colname_Recordset4 = "-1";
if (isset($_GET['id'])) {
$colname_Recordset4 = $_GET['id'];
}
mysql_select_db($database_database, $database);
$query_Recordset4 = sprintf("SELECT * FROM maskinenoter WHERE id = %s", GetSQLValueString($colname_Recordset4, "int"));
$Recordset4 = mysql_query($query_Recordset4, $database) or die(mysql_error());
$row_Recordset4 = mysql_fetch_assoc($Recordset4);
$totalRows_Recordset4 = mysql_num_rows($Recordset4);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CHANCEN-System</title>
<style type="text/css">
<!--
body {
background-color: #969A9D;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.row0 {
background-color: #F7F6F4;
}
.row1 {
background-color: #cccccc;
}
.style1 {
font-size: 9px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style11 {font-size: 9px}
.style12 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style14 {color: #FFFFFF; font-weight: bold; }
-->
</style></head>
<body>
<div align="center">
<p> </p>
<table width="881" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="28"> </td>
<td colspan="2"><img src="img/topbanner.png" alt="" width="825" height="25" /></td>
<td width="28"> </td>
</tr>
<tr>
<td style="background-image:url(img/leftsidebg.png); background-repeat:repeat-y;" rowspan="4"> </td>
<td colspan="2" style="background-image:url(img/bgmidt.png); background-repeat:repeat-y;"><img src="img/menu.png" alt="" width="825" height="89" /></td>
<td style="background-image:url(img/rightsidebg.png); background-repeat:repeat-y;" rowspan="4"> </td>
</tr>
<tr>
<td colspan="2" style="background-image:url(img/bgmidt.png); background-repeat:repeat-y;"> </td>
</tr>
<tr>
<td width="155" valign="top" style=" margin: 3px; background-image:url(img/sidemenubg.png); background-repeat:repeat-y;"><p align="left" class="style1">Spillehaller:</p>
<?php do { ?>
<p align="left" class="style1"><?php echo $row_Recordset1['navn']; ?></p>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></td>
<td width="670" valign="top" style="background-image:url(img/bgmidt.png); background-repeat:repeat-y;"><p align="left" class="style1">Maskiner i <?php echo $row_Recordset1['navn']; ?></p>
<div align="right"></div>
<div align="right">
<table width="625" border="0" align="center" cellpadding="3" cellspacing="0">
<tr bgcolor="#00ADEF">
<td width="425"><div align="left" class="style14"><span class="style1">MASKINE NAVN</span></div></td>
<td width="200"><div align="left" class="style14"><span class="style1">STATUS</span></div></td>
</tr>
</table>
<div align="center"></div>
<table width="625" align="center" cellpadding="3" cellspacing="0">
<?php do { ?>
<tr class="row<?= $rowclass ?>">
<td width="425" class="style11 style12"><div align="center" class="style11 style12">
<div align="left"><span class="style12"><?php echo $row_Recordset2['navn']; ?></span> ( <?php echo $row_Recordset2['nummer']; ?> )</div>
</div></td>
<td width="200" align="center" class="style11 style12"><div align="left"><span class="style1"">
<?php if ($row_Recordset2["status"] == '0') {
print("Normal");
}
else if ($row_Recordset2["status"] == '1') {
print("Reseveret");}
else if ($row_Recordset2["status"] == '2') {
print("Defekt (?)");}
?>
</span></div></td>
</tr>
<?php
$rowclass = 1 - $rowclass;
?>
<?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?>
</table>
</div></td>
</tr>
<tr>
<td colspan="2" style="background-image:url(img/bgmidt.png); background-repeat:repeat-y;"> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><img src="img/bundbanner.png" width="825" height="24" /></td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
mysql_free_result($steder);
mysql_free_result($Recordset3);
mysql_free_result($Recordset4);
?>