I have a problem, if someone can help great!!
Every time the form is submitted to delete the stabletitle it says successful even when the title entered is not in the database,
if its not in the database it should say unsucessful, can someone see what is wrong with my code?
Any help is great!
<?php
session_start();
include('dbconnect.php');
$stabletitle = $_POST["stabletitle"];
$SQLcmd = "DELETE FROM stables WHERE stabletitle ='$stabletitle'";
if (!$_POST['stabletitle'])
{ ?>
<center> <h3> <font color=#C11B17> You have not entered any information!! Please try again.... </font> </h3> </center>
<?php }
else if (mysql_query($SQLcmd, $con)){
print ("**The information has been successfuly deleted** <br>");
$result = mysql_query("Select * From stables ORDER BY displayorder, stabletitle"); ?>
<br> </br> <center> <h3> Below is the remaining information which can be displayed within the stables page: </h3> <br> </br> </center>
<?php
print ' <table class="border"><th> Content Title <th> Content <th> Display Order </th>';
while ($row = mysql_fetch_array($result))
{
print
"<tr><td>".$row['stabletitle']."</td><td>".$row['stablecontent']."</td><td>".$row['displayorder']."</td></tr>";
}
print "</table>";
}
else{ ?>
<font color=#C11B17> <p> You were unsuccessfull in deleting the information you requested! Please try again... </p> </font>
<?php
}
mysql_close($con);
?>