Har lavet en kode til siden
www.xxxxx.dk og nu viser den dette:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'from shipping as si left join payment' at line 3
er der nogen der kan se hvad der er galt og hvad der skal ændres?
<?php
session_start();
//etablerer forbindelse til databasen
$conn = mysql_connect("mydb1.surftown.dk", "XXX", "XXX")
or die(mysql_error());
mysql_select_db("michell_varelager",$conn) or die(mysql_error());
$display_block = "<h1>Detaljer om varen</h1>";
//validering af varen
$get_shipping = "select c.name, si.name,
si.pris, si.description,
from shipping as si left join payment
as c on c.id = si.payment where si.id = $_GET[id]";
$get_shipping_res = mysql_query($get_shipping)
or die (mysql_error());
if (mysql_num_rows($get_shipping_res) <1) {
//varen ikke valid
$display_block .= "<P><em>Invalid vare valg</em>
</p>";
} else {
//varen ok, hent oplysninger
$name = strtoupper(stripslashes(
mysql_result($get_shipping_res,0,'name')));
$name = stripslashes(mysql_result($get_shipping_res,0,
'name'));
$pris =
mysql_result($get_shipping_res,0,'pris');
$description = stripslashes(mysql_result($get_shipping_res,0,
'description'));
//Lav et "brødkrummespor"
$display_block .= "<P><strong><em>vælg betalingsmåde:</em>
<br>
> $name</strong></p>
<table cellpadding=3 cellspacing=3>
<tr>
<td valign=middle><P><strong>Beskrivelse:</strong><br>
$description</p>
<P><strong>Pris:</strong> kr.$pris</p>
<form method=post action=\"visikasse.php\">";
$display_block .= "
</select>
<input type=\"hidden\" name=\"sel_item_id\"
value=\"$_GET[item_id]\"><P><input type=\"submit\"
name=\"submit\" value=\vælg\"></p>
</form>
</td>
</tr>
</table>";
}
?>
<html>
<head>
<Titel></Titel>
<link rel="stylesheet" type="text/css" href="rullepanel.css">
<style>
a {text-decoration: none}
</style>
</head>
<body>
<? print $display_block; ?>
</body>
</html>