Answer the question
In order to leave comments, you need to log in
Where should mysqli object be created?
Всем привет! Пишу сейчас обращение к БД через ajax.
$.ajax
({
url: "server.php",
data: { func:"RegUser", password:$("#reg_password").val(),email:$("#reg_email").val() },
success: function( data )
{
// ответ
}
});
Answer the question
In order to leave comments, you need to log in
Each ajax request, as well as the opening of each page, re-runs the php script on the server.
Therefore, from the point of view of saving the object between ajax requests, there is no difference - the object will always be created anew.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question