Jump to content

Calling a function twice


Jezza22

Recommended Posts

I have a php function that gets the next available document number, from a MYSQL database, which works great. I have a page, that combined with php/javascript and using an Ajax method, updates the database and increments the document number.

 

The problem I have is refreshing the page to show incremented document number.

 

Is it possible call the function again and it perform function again, retrieving the new values from the database, without submitting the page?

 

I have tried lots of things with no success.

 

I'm fairly new so please bear with me :)

 

Here's the function: -

 

function DocumentNext()
{
	$query = "SELECT * FROM counts_file;";
	$result = mysql_query($query);			
	$nextDoc=mysql_result($result,$j,'Document');


	echo $nextDoc;

}

 

I can post the remainder of the code if necessary that containts the javascript let me know?

Link to comment
https://forums.phpfreaks.com/topic/155071-calling-a-function-twice/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.