Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Mysql row DELETE

Parašė weberiz· 2011 Bir. 8 13:06:23
#15


<?php
if (isset($_POST['id'])) {
	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("cb_db", $con);
	$trinti = mysql_query("DELETE FROM dienorastis WHERE Id='".$_POST['id']."'");
	if ($trinti) { echo "Istrinta"; } else { echo "klaida"; }
	mysql_close($con);
} else {
echo "<form action=\"trinti.php\" method='post'>
  id: <input type='text' name='id' /><br />
  <input type=\"submit\" value=\"trinti\" />
</form>";
}
?>

va :)
viska i trinti.php

Redagavo weberiz· 2011 Bir. 8 13:06:33