Click here to Skip to main content
14,488,259 members
Rate this:
Please Sign up or sign in to vote.
See more:
<?php
session_start();
    include('functions.php');
 $id = ''; 
if( isset( $_GET['id'])) {
    $id = $_GET['id']; 
} 
    $query = "SELECT * FROM `listhouse` WHERE `id` = '$id'; ";  
      if(count(fetchAll($query)) > 0)
        {
        foreach(fetchAll($query) as $row)
        {
$id=$row['id'];
$name=$row['name'];
$phno=$row['phno'];    
$paddress=$row['paddress'];
$city=$row['city'];
$pincode=$row['pincode'];
$lsno=$row['lsno'];
$bu=$row['bu'];
$regno=$row['regno'];
$area=$row['area'];
$l=$row['l'];
$municipal=$row['municipal'];
$engname=$row['engname'];
$c=$row['c'];
$date=$row['date];
            $query = "INSERT INTO `approvedhouse`(`taxno`, `id`, `name`, `phno`, `paddress`, `pincode`, `lsno`, `bu`, `regno`, `area`, `l`, `municipal`, `engname`, `c`, `date`, `message`, `status`) VALUES (NULL,'$id','$name''$phno','$paddress','$pincode','$lsno','$bu','$regno','$area','$l','$municipal','$engmane','$c','$date','approved','unread') ;";
        }
        $query .= "DELETE FROM `listhouse` WHERE `listhouse`.`id` = '$id';";
        if(performQuery($query))
            {
            echo "Account has been accepted.";
           header('location:homehouse.php');
            }
        else{
            echo "Unknown error occured. Please try again.";
             }
       // }
    //else{
      //  echo "Error occured.";
    //}
?>


What I have tried:

the error occured when execution this program
and it worked before but not now
Posted
Updated 1-Nov-19 8:29am
Comments
MadMyche 1-Nov-19 14:30pm
   
I'll consider looking into this when you start fixing the other problems people are noticing; such as the SQL Injection Vulnerability which has been pointed out to you on every one of your posts regarding this block of code

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Try to replace
$date=$row['date];

with
$date=$row['date'];
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100