still a blank page on the first one?
Hmm....maybe your if condition has a problem...
Can you try to comment out all of your if code.
So basically it just says:
mysql_connect("localhost","cotjah","****"); //connect to the mySQL
mysql_select_db("cotjah_news");
$sql = "DELETE FROM news WHERE id=$id";
$result = mysql_query($sql);
echo "<div align='center'>";
echo "News deleted!";
that way we can break the code down into sections and find out where the error is occuring...
Also, are you sure you put the error checking after all of your database queries? That should have given a more specific error than the "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL "
Also on your second page, I would clean this code up a bit:
if(!$cmd)
{
$result = mysql_query("select * from news"); //replace news with your table name
while($r=mysql_fetch_array($result))
{
$title=$r["title"];
$message=$r["newstext"];
?>
<INPUT TYPE="RADIO" NAME="id" VALUE="<?php echo $id;?>"><? echo $id;?> <? echo $title ?><br>
<? } ?>
<input type="submit" name="cmd" value="edit"></form>
<? } ?
change to:
if(!$cmd)
{
$result = mysql_query("select * from news"); //replace news with your table name
while($r=mysql_fetch_array($result))
{
$title=$r["title"];
$message=$r["newstext"];
echo "<INPUT TYPE=\"RADIO\" NAME=\"id\" VALUE=\"$id;\">$id $title <br>";
}
echo "<input type=\"submit\" name=\"cmd\" value="edit"></form>";
}
And I would do that for all of your code.
I don't think you want to start and if/while statement, end your php code with the ?> then start it again later.
That could be causing the error on the second page.
Try to clean that code up so it is one large php block instead of php/html/php/html etc...