Printf is not working in AJAX php file? : <p>Hi I want to update some data in my mysql database by using form in html and AJAX  technology. I have problem because data is not updated after click on submit and in response message I have not only message but clear mysql ask too! Let's look at my alert:
<a href="https://i.stack.imgur.com/gc8od.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gc8od.png" alt="enter image description here"></a></p>

<p>My idea is the printf is not really post text into "query" function but this text output is going stright into response data and query is always wrong from empty text...</p>

<p>Let's look at my AJAX php file:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
	session_start();
	error_reporting(0);
	$imie = $_POST['imie'];
	$nazwisko = $_POST['nazwisko'];
	$kodpocztowy = $_POST['kodpocztowy'];
	$ulica = $_POST['ulica'];
	$nrdomu = $_POST['nrdomu'];
	$nrmieszkania = $_POST['nrmieszkania'];
	$miasto = $_POST['miasto'];

	try
	{
		if (! @include_once('connect.php'))
  		throw new Exception ('connect.php kurwa nie istnieje&lt;/br&gt;');
		if (!file_exists('connect.php' ))
  		throw new Exception ('connect.php nie istnieje&lt;/br&gt;');
		else
  		require_once('connect.php'); 
	}
	catch(Exception $e)
	{    
  		echo "Wiadomość: " . $e-&gt;getMessage();
  		echo "Kod: " . $e-&gt;getCode();
	}
	require_once "connect.php";

	$polaczenie = @new mysqli($host, $db_user, $db_password, $db_name);
	if($rezultat = @$polaczenie-&gt;query(printf("UPDATE adresy SET imie='%s', nazwisko='%s', kodpocztowy='%s', ulica='%s', nrdomu='%s', nrmieszkania='%s', miasto='%s' WHERE id=%s",$imie,$nazwisko,$kodpocztowy,$ulica,$nrdomu,$nrmieszkania,$miasto,$_SESSION['id'])))
	{
		$polaczenie-&gt;close();
		echo "Good!";
	}
	else
	{
		$polaczenie-&gt;close();
		echo "Not good!";
	}

	
?&gt;</code></pre>
</div>
</div>
</p>

<p>Have you any idea how to solve this problem? Maybe what to use instead printf or echo? Please help, greatings.</p>
