Jeg har flg. kode
Men den vill ikke tilføje i databsen hvorfor!
(jeg tror jeg har fundet ud af at det er fordi den slet ikke køre kode, så hvordan får jeg den til at køre kode?)
$foresp = "INSERT INTO `names` ( `id` , `Name` , `Gender` , `Meaning` , `Link` , `Oprindelse` , `ex1` , `ex2` , `ex3` , `ex4` , `ex5` ) VALUES ( '', '$Navn', '$Gender', '$Mean', '$Link', '$Opr', '$exk1', '$exk2', '$exk3', '$exk4', '$exk5' ) ";
?>
prøv at tilføje
mysql_query($foresp) or die(mysql_error());
lige neden under.
Mvh
Kaare
<pre>
<?
$cn = $_GET["cn"];
$cou = $_GET["cou"];
$Logko = $_GET["Lok"];
//$Gender = $_GET["Gender"];
//$Mean = $_GET["Mean"];
//$Opr = $_GET["Opr"];
//$Link = $_GET["Link"];
//$exk1=$_GET["exk1"];
//$exk2=$_GET["exk2"];
//$exk3=$_GET["exk3"];
//$exk4=$_GET["exk4"];
//$exk5=$_GET["exk5"];
$i++;
echo("$i");
if($Logko=="yes")
{
mysql_connect ("localhost","*********************","**********************************");
mysql_select_db ("test");
//$foresp=mysql_query("INSERT INTO `names` (`id` , `Name` , `Gender` , `Meaning` , `Link` , `Oprindelse` , `ex1` , `ex2` , `ex3` , `ex4` , `ex5` ) VALUES ('', '$Navn', '$Gender', '$Mean', '$Link', '$Opr', '$exk1', '$exk2', '$exk3', '$exk4', '$exk5')");
$foresp = "INSERT INTO `names` ( `id` , `Name` , `Gender` , `Meaning` , `Link` , `Oprindelse` , `ex1` , `ex2` , `ex3` , `ex4` , `ex5` ) VALUES ( '', '$Navn', '$Gender', '$Mean', '$Link', '$Opr', '$exk1', '$exk2', '$exk3', '$exk4', '$exk5' ) ";
mysql_query($foresp) or die(mysql_error());
//$foresp=mysql_query("INSERT INTO names SET Name = '$Navn', Gender = '$Gender', Meaning = '$Meaning', Link = '$Link', Oprindelse = '$Opr', ex1 = '$exk1', ex2 = '$exk2, ex3 = '$exk3', ex4 = '$exk5, ex5 = '$exk5'");
//$foresp = mysql_query("INSERT INTO names SET Name = '$Navn', Gender = '$Gender', Meaning = '$Meaning', Link = '$Link', Oprindelse = '$Opr', ex1 = '$exk1', ex2 = '$exk2, ex3 = '$exk3', ex4 = '$exk5, ex5 = '$exk5'" ) or die("error performing query");
}
?>
<html>
<head>
<title>Nyt dokument</title>
<meta name="generator" content="TSW WebCoder">
</head>
<body>
<form method=post action=<? echo("indset.php?cn=$exk1&cou=$Opr");?>>
Navn <input type="text" name="Navn"><br>
Meaning <textarea rows="5" name="Mean"></textarea><br>
Gender <input type="text" name="Gender"><br>
Oprindelse <input type="text" name="Opr" value=<?echo("$cou");?>><br>
ex1 <input type="text" name="exk1" value=<?echo("$cn");?>><br>
ex2 <input type="text" name="exk2"><br>
ex3 <input type="text" name="exk3"><br>
ex4 <input type="text" name="exk4"><br>
ex5 <input type="text" name="exk5"><br>
Link <input type="text" name="Link">
<input type="hidden" name="Logko" value="yes"><br><br>
<input type="submit" name="indzet" value="- - I N D SÆ T - -">
<input type="reset" name="reset" value="- - R E S E T - -">
</form>
</body>
</html>
</pre>
Det virker ikke, heller ikke de foresp som er i komentar form " // "
Hvorfor ?
Please help me!!
-Thomas
.-(