Hello i have this code....well although the select statements work fine...i do have problem with the output page. I want when both statements are true to echo that the action has been implemented successfully otherwise the opposite....but it doesnt seem to work
some to help please
thanks
<?php
session_start();
ob_start();
require ('main.php');
$page = new homePage();
$page -> content = '<p class = "content"> Student Registry </p> <br><br><br><br> ';
$page -> Display();
$topid = $POST['topid'];
$superid = $SESSION['valid_superid'];
if (!$topid)
{
echo '<p> You have not filled all the required fields.<br> Please go <a href = deletetop.php> back </a> and try again </p>';
exit;
}
if (!get_magic_quotes_gpc())
{
$topid = addslashes($topid);
}
$db_conn3 = new mysqli('localhost', 'root', '323232', 'project');
if(mysqli_connect_errno())
{
echo 'Connection to database failed:'.mysqli_connect_error();
exit();
}
$query = "delete top_staff, topic from top_staff, topic, staff where top_staff.top_id = topic.top_id and staff.staff_id = top_staff.staff_id and top_staff.top_id = '$topid' and top_staff.staff_id = '$superid'";
$query2 = "select * from top_staff where top_id = '$topid' and staff_id = '$superid'";
$result2 = $db_conn3->query($query2);
$result = $db_conn3->query($query);
if ($result2 > 0 && $result > 0)
{
// if they are in the database register the user id
echo '<p> You successfully updated the record.</p>';
echo '<p>Please go <a href = chktopprop.php> back </a> to check if the record still exists</p>';
}
else
{
echo 'no';
}
$db_conn3->close();
?>