Hello
I have the following code which i found but it doesnt work properly.. it comes up with a list of the items in the database
e.g.
item 1 - delete
item 2 - delete
item 3 - delete
but when i click delete it deletes a different row and cannot for the life of me figure out why. e.g. if i click delete on item 2 it deletes item 3.
Code: <?php
//If cmd is not hit
if(!isset($cmd))
{
//display all the tbl_testimonies
$result = @mysql_query('SELECT * FROM tbl_testimonies');
if (!$result) {
exit('<p>Error!<br />'.
'Error: ' . mysql_error() . '</p>');
}
while ($r = mysql_fetch_array($result)) {
extract($r);
//grab the tenants_house_name and the tenant_house_id of the enws
$tenants_house_name=$r["tenants_house_name"];//take out the tenants_house_name
$tenant_house_id=$r["tenant_house_id"];//take out the tenant_house_id
echo "<a href='delete.php?cmd=delete&tenant_house_id=$tenant_house_id'>$tenants_house_name - Delete</a>
";
// echo "$tenants_house_name " . "<a href='delete.php?cmd=delete&tenant_house_id=$tenant_house_id'>Delete</a>" ;
}
}
?>
<?php
if($_GET["cmd"]=="delete")
{ $sql = "DELETE FROM tbl_testimonies WHERE tenant_house_id=$tenant_house_id";
$result = mysql_query($sql);
echo "Row deleted!";
}
?>
Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I don;t want people to be able to browse directly to this page. Whati s the best wasy to achieve this?
Allowing ' and "
Hello everyone,I am creating a form where users submit information to go into a database. I want the users to be allowed to use both ' and " in their messages, but the problem is when I try to
displaying unknown amount of results
I am reading a directory and getting a list of folders in the directory, I want to display the folders in a table which is 6 columns of results across by how ever may rows, here is the code I am using
Sales orders ans reservations not taken into account on MPS / MRP
Hello,
How to make a input/output field with multiple lines
Hello.
extract a file from zip file
hi,i know how to unzip a zip file in php, but is there a way to just extract a certain file only?
how to load a Sys file with system load and call images?
normally you need register the module as a service with CreateService, and start the service
check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard method used for checking to see if a value exists in a database before inserting a value? I have a form,
I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my news are repetition of raw 2. http://www.demirtepe.net/haber/index17.phpAs a matter of fact, I had
extract data
Code: <div class="post hentry uncustomized-post-template"> <div id="post-title-wrapper"> <a