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!";
}
?>
CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect and start from next sentenceI am splitting into two sentences"This is first sentence." This
Pipe email to PHP - get mail adress from MySQL - send?
Hi all,this is the challenge:1) Our faculty at the college where I'm employed includes quite a bit of freelancers that don't check the college mailbox quite as often as the administration would
Preventing blank or already entered values
Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLANK entries, into my process php script, using feof, I have failed many times and get so many errors
question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or should i always put a die() function underneath the header() function?
convert static html data into dynamic
hi alli need to convert a website which has static above 2000 articles into dynamic and add that data into database. one solution i know is copy and paste it manually.is there any other formula or
upload photo limits
ive got a upload photo script and im just trying to make more secure currently it limits size and as you can see from my code below it limits only gif and php fileshow do i edit my code to limit all
problem getting my contact form working
Yeah I know this is a pretty basic problem, but it's been a while since I've worked with PHP and I'm having a real problem getting it functioning properly. My real issue is the user inputed
Solution Manager BPR
Does the SolMan-BPR-ARIS-Integration (http://www.ids-scheer.com/en/ARIS/ARIS_Platform/ARIS_Business_Architect_for_SAP/3743.html ) use an interface open to the public? If yes, were can I finde some
setcookie and isset($_COOKIE(name)) seem very finnicky.
I'm currently playing around with a user system with login and registration. I'm trying to use cookies to log the user in but the cookie either doesn't set or it sets after I travel through a few
Thought I has this figured out especially after all the help i received?
Cags, Salathe, Daniel helped me with this yesterday, but not sure i took it all in.I am attempting to open the URL and grab all the links within using preg_match_allThe problem is Parse error: syntax