Welcome! Log In Create A New Profile

Advanced

PHP help - Some codes not running as expected.

Posted by MOKIRI 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
PHP help - Some codes not running as expected.
May 22, 2012 11:15AM
I am doing my software project implemetation system using the php language and i have ran the following code expecting it to delete a row from the database after i click the yes button but it does not perform as expected.

Language: PHP
<?php error_reporting(0); include("C:\Program Files\EasyPHP-5.3.3\www\project\connect.php");   connectToDB();   $ownerID =$_GET['OwnerID'];   $SQL = "SELECT ownerID, ownerName, ownerSurname FROM owner WHERE ownerID='$ownerID'"; $result = mysql_query($SQL);   while($row = mysql_fetch_array($result)){   $ownerID = $row['ownerID']; $ownerName = $row['ownerName']; $ownerSurname = $row['ownerSurname'];   } if(isset($_REQUEST["yes"])){   $query = "DELETE FROM owner WHERE ownerID='$ownerID'"; $results = mysql_query($query);   header ("Location: adminDelete1.php");   } if(isset($_REQUEST["no"])){   header("location:adminDelete1.php");   }   ?> // form <?php echo "Are you sure you want to delete <font color='lime'><b> $ownerName $ownerSurname</b></font> from a list of owners? ";?>   // button YES and NO //close form

if i click the yes button it goes to the right location but it does not delete. Can anyone pls tell me where i got it wrong.
Re: PHP help - Some codes not running as expected.
May 22, 2012 01:03PM
Might be a silly question, but have you echo your sql statement to check if it does actually contain the correct parameters as expected?

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: PHP help - Some codes not running as expected.
May 22, 2012 03:40PM
Yes 31097812 Bokkie i did it, but im fine now i managed to crack the solution. thanx for the advice though smileys with beer
Re: PHP help - Some codes not running as expected.
May 22, 2012 05:05PM
Share!!! smiling smiley

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Sorry, you do not have permission to post/reply in this forum.