0

Hi
When I load my renew.php page - the following warning appears. However when I click the 'renew' button in the page, the code below still works, but only when I click the 'renew' button twice.

I can't find what is wrong with the code to cause the error message though? Any ideas would be much appreciated. Many thanks.

<?php require_once('Connections/dreamsin_localhost.php'); 
      require_once('myaccess/appvars.php');

// Connect to the database
  $dbc = mysqli_connect("localhost", "xxxxxxxxx", "xxxxxxxxxx", "xxxxxxxxxxxx");
  
  if (isset($_POST['submit'])) {
  $prop_id = $_POST['prop_id'];
  
  
  // Connect to the database
  $dbc = mysqli_connect("localhost", "xxxxxxxxx", "xxxxxxxxxx", "xxxxxxxxxx");
  
	  $query = "UPDATE DEV_property_details SET
	  add_date = NOW()
	  WHERE prop_id = '$prop_id' LIMIT 1";
  }
  mysqli_query($dbc, $query);
  mysqli_close($dbc);
		
  ?>
1
Contributor
2
Replies
4
Views
6 Years
Discussion Span
Last Post by ebanbury
0

Apologies - If forgot to add that the line it doesn't like is:

mysqli_query($dbc, $query);

thanks

0

Hi it has been solved. Very silly mistake..just the bracket in the wrong place..correct code is:

// Connect to the database
  $dbc = mysqli_connect("localhost", "xxxxxxxxx", "xxxxxxxxxx", "xxxxxxxxxxxx");

  if (isset($_POST['submit'])) {
  $prop_id = $_POST['prop_id'];


  // Connect to the database
  $dbc = mysqli_connect("localhost", "xxxxxxxxx", "xxxxxxxxxx", "xxxxxxxxxx");

      $query = "UPDATE DEV_property_details SET
      add_date = NOW()
      WHERE prop_id = '$prop_id' LIMIT 1";

  mysqli_query($dbc, $query);
  mysqli_close($dbc);
        }
  ?>

Edited by Dani: Formatting fixed

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.