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);
		
  ?>

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

mysqli_query($dbc, $query);

thanks

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);
        }
  ?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.