I tried lot functions of internet, however it doesn't works, and I can't find out where is mistake :S
This is my edit.php:It's working perfectly, however.. If I write a new information and post it into my this update.php:PHP Code:<?
////////////////////////////////////////////////////////
// Prisegame MySQL nustatymus //
////////////////////////////////////////////////////////
include('_include/dbsettings.php');
/////// Jungiames prie MySQL ir pasirenkame lentele
mysql_connect(host,user,pass) or die(mysql_error());
mysql_select_db(db_table);
$id = $_GET["id"];
$sql = "SELECT * FROM naujienos WHERE id=$id";
$result = mysql_query($sql);
$i=0;
$id=mysql_result($result,$i,"id");
$tema=mysql_result($result,$i,"tema");
$naujiena=mysql_result($result,$i,"naujienos");
echo "<form action=\"update.php\" method=\"post\">
<span style='visibility:hidden;'><input type='text' name='id' value=".$id." /></span>
Tema: <input name='tema' type=\"text\" size=\"9\" value=".$tema."> <br />
Naujiena: <textarea name='naujiena'>".$naujiena."</textarea>
<input type=\"submit\" value=\"Save Changes\">
</form>";
mysql_close();
?>It's not updating the row I need. Actually it's only shows that record updated however it's not.PHP Code:<?
////////////////////////////////////////////////////////
// Prisegame MySQL nustatymus //
////////////////////////////////////////////////////////
include('_include/dbsettings.php');
/////// Jungiames prie MySQL ir pasirenkame lentele
mysql_connect(host,user,pass) or die(mysql_error());
mysql_select_db(db_table);
$ud_id=$_POST['id'];
$ud_tema=$_POST['tema'];
$ud_naujiena=$_POST['naujiena'];
$query="UPDATE naujienos SET tema='$tema', naujienos='$naujiena' WHERE id='$id'";
mysql_query($query);
echo "Record Updated";
mysql_close();
?>
Any ideas?



Reply With Quote

Bookmarks