Jeg har dette problem der kommer error frem og da jeg ikk er god til php aner jeg ikk en skid om hvad fejlen er...
Dette er koden man skriver retelserne ind i:
<?php
$host="*";
$username="*";
$password="*";
$db_name="*";
$tbl_name="*";
mysql_connect("$host", "$username", "$password")or die("Kan ikke connecte");
mysql_select_db("$db_name")or die("cannot select db");
$id=$_GET['id'];
$sql="SELECT * FROM $tbl_name WHERE id='$id'";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
<html>
<body>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form id="form1" name="form1" method="post" action="tilfqj-r.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3" bgcolor="#E6E6E6"><strong>Redigere tråd</strong> </td>
</tr>
<tr>
<td valign="top"><strong>Forside</strong></td>
<td valign="top">:</td>
<td><textarea name="forside" cols="40" rows="2" id="forside"></textarea></td>
</tr>
<tr>
<td width="14%"><strong>Artikel</strong></td>
<td width="2%">:</td>
<td width="84%"><input name="topic" type="text" id="topic" size="50" /></td>
</tr>
<tr>
<td valign="top"><strong>Tekst</strong></td>
<td valign="top">:</td>
<td><textarea name="detail" cols="50" rows="3" id="detail"><? echo $rows['detail']; ?></textarea></td>
</tr>
<tr>
<td><strong>Navn</strong></td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50" /></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td>:</td>
<td><input name="email" type="text" id="email" size="50" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
}
mysql_close();
</body>
</html>
Dette er koden som (skulle) sætte den ind i db'en, som der kommer fejl frem istedet:
<?php
$host="*";
$username="*";
$password="*";
$db_name="*";
$tbl_name="*";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$topic=$_POST['topic'];
$detail=$_POST['detail'];
$name=$_POST['name'];
$email=$_POST['email'];
$forside=$_POST['forside'];
mysql_query("UPDATE database SET topic='$topic' WHERE id='$noget'");
$result=mysql_query($sql);
if($result){
echo "Den er nu redigeret<BR>";
}
else {
echo "ERROR";
}
mysql_close();
?>
nogle der kan hjælpe bliver der direkte 180 point til dig
afse