Hey,
First of, if you state in your signature that you are world's best HTML pro, don't use a tag called 'heaitle' :p
Ok, second my question is what are you trying to do?
Update a news item?
If, yes this is how you do it. (simple way)
You have a table news, i can see that. But the news-item has to have something unique. So if you don't have it make a column that has a auto incremental integer and give that column the unique key.
Ok that done let's create the edit page.
<html>
<head>
<title>Update form</title>
</head>
<body>
<?php
require_once('test.css');
$link = mysql_connect("localhost", "root", "");
mysql_select_db("name", $link);
$qry = mysql_query("SELECT Nid, nws FROM news ORDER BY nws DESC", $link);
while($aResult = mysql_fetch_array($qry){
echo "<form method=\"post\" action=\"update.php\">";
echo "<textarea cols=40 rows=10 name=\"news\">";
echo $aResult['nws'];
echo "</textarea>";
echo "<input type=\"hidden\" name=\"Nid\" value=\"$aResult['Nid']\">"
echo "<input type=\"submit\"></form>";
echo "<br>";
}
?>
</body>
</html>
Ok, that should give you forms where you can type in every news-item and hit the submit button.
BTW, (again nagging about your sig.) throw the output in a table wich would be no problem as you are a html PRO.
How to update it
Create a page called update.php (stated as action of your form).
<html>
<head>
<title>Update form</title>
</head>
<body>
<?php
require_once('test.css');
/*get values*/
$iNid = $_POST['Nid'];
$sNws = $_POST['nws'];
$link = mysql_connect("localhost", "root", "");
mysql_select_db("name", $link);
$qry = mysql_query("update news set nws = '$sNWS' where Nid = $iNid", $link) or die('Error during update query');
if($qry){
echo "Update passed";
}else{
echo "Update failed";
}
}
?>
</body>
</html>
This will do the trick.
Last remarks:
This:
?><?php
doesn't do anything you escape from PHP and re-enter php mode right after it.
Edit: Sorry, if my English is hard to understand but it ain't my native language.
Edit2:
Again it will sound like nagging but do see i'm trying to help you.
At one moment you do this:
if (mysql_num_rows($qry) > 0) {
for ($j = 0; $j<mysql_num_rows($qry); $j++) {
If you think about it you can leave out the if statement... why?
Well, IF mysql_num_rows is 0 it won't enter the FOR loop because
$j = 0;
and mysql_num_rows = 0
So 0 < 0 isn't satisified so no entry in the FOR loop.