Click here to Skip to main content
15,907,913 members
Please Sign up or sign in to vote.
1.00/5 (1 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

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

with
PHP
$date=$row['date'];
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900