Not able to get php parsed data in framework7 through ajax call





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















function pendingorder(){

app.request({
type:"POST",
url: "pages/getpeningorer.php",
dataType: 'json',
cache: false,
success:function(data) {
console.log(data);
var result = $.parseJSON(data);
$.each(result, function(key, value){
$.each(value, function(k, v){
if(k === "order_id"){
$("#pendingtable >tbody:last").append(
$('<tr>').append(
$('<td>').append(v)
.append(
$('</td>').append(
$('</tr>')
)
)
)
);
}
if(k === "product_id"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "status"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "remark"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}
if(k === "postingDate"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

});
});
console.log(data);}
});
console.log('execute success');
}

I AM trying to call ajax through function....But not working. In a similar way, I post data it is working.


PHP code:



enter code here



$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);

if (mysqli_connect_error()) {
die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
} else {
$sql = "SELECT order_id,product_id,status,remark,postingDate FROM order_track_history where status='In process'";
$result = $conn->query($sql);
}
$Pdata = array();
while ($row = mysql_fetch_array($result)) {
$picture = array(
"order_id" => $row['order_id'],
"product_id" => $row['product_id'],
"status" => $row['status'],
"remark" => $row['remark'],
"postingDate" => $row['postingDate']
);
$Pdata = $picture;
}`enter code here`
echo json_encode($Pdata);


Here I am sending my data to ajax calls in JSON format. But not able to see data at HTML page.










share|improve this question

























  • have you tried console.log the data return by your php script?

    – Buddy
    Nov 29 '18 at 5:37











  • not getting data also in console

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 5:38











  • if you access this page pages/getpeningorer.php direct from browser, what is result will you got?

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:44











  • -- also make sure you are enable error in php.ini or set this code in your php file error_reporting(E_ALL); ini_set('display_errors', 1);

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:49











  • work after setting var result = $.parseJSON(data); to var result = data;

    – MANDAR MAHADEOKAR
    Dec 3 '18 at 8:57




















1















function pendingorder(){

app.request({
type:"POST",
url: "pages/getpeningorer.php",
dataType: 'json',
cache: false,
success:function(data) {
console.log(data);
var result = $.parseJSON(data);
$.each(result, function(key, value){
$.each(value, function(k, v){
if(k === "order_id"){
$("#pendingtable >tbody:last").append(
$('<tr>').append(
$('<td>').append(v)
.append(
$('</td>').append(
$('</tr>')
)
)
)
);
}
if(k === "product_id"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "status"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "remark"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}
if(k === "postingDate"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

});
});
console.log(data);}
});
console.log('execute success');
}

I AM trying to call ajax through function....But not working. In a similar way, I post data it is working.


PHP code:



enter code here



$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);

if (mysqli_connect_error()) {
die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
} else {
$sql = "SELECT order_id,product_id,status,remark,postingDate FROM order_track_history where status='In process'";
$result = $conn->query($sql);
}
$Pdata = array();
while ($row = mysql_fetch_array($result)) {
$picture = array(
"order_id" => $row['order_id'],
"product_id" => $row['product_id'],
"status" => $row['status'],
"remark" => $row['remark'],
"postingDate" => $row['postingDate']
);
$Pdata = $picture;
}`enter code here`
echo json_encode($Pdata);


Here I am sending my data to ajax calls in JSON format. But not able to see data at HTML page.










share|improve this question

























  • have you tried console.log the data return by your php script?

    – Buddy
    Nov 29 '18 at 5:37











  • not getting data also in console

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 5:38











  • if you access this page pages/getpeningorer.php direct from browser, what is result will you got?

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:44











  • -- also make sure you are enable error in php.ini or set this code in your php file error_reporting(E_ALL); ini_set('display_errors', 1);

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:49











  • work after setting var result = $.parseJSON(data); to var result = data;

    – MANDAR MAHADEOKAR
    Dec 3 '18 at 8:57
















1












1








1








function pendingorder(){

app.request({
type:"POST",
url: "pages/getpeningorer.php",
dataType: 'json',
cache: false,
success:function(data) {
console.log(data);
var result = $.parseJSON(data);
$.each(result, function(key, value){
$.each(value, function(k, v){
if(k === "order_id"){
$("#pendingtable >tbody:last").append(
$('<tr>').append(
$('<td>').append(v)
.append(
$('</td>').append(
$('</tr>')
)
)
)
);
}
if(k === "product_id"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "status"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "remark"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}
if(k === "postingDate"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

});
});
console.log(data);}
});
console.log('execute success');
}

I AM trying to call ajax through function....But not working. In a similar way, I post data it is working.


PHP code:



enter code here



$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);

if (mysqli_connect_error()) {
die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
} else {
$sql = "SELECT order_id,product_id,status,remark,postingDate FROM order_track_history where status='In process'";
$result = $conn->query($sql);
}
$Pdata = array();
while ($row = mysql_fetch_array($result)) {
$picture = array(
"order_id" => $row['order_id'],
"product_id" => $row['product_id'],
"status" => $row['status'],
"remark" => $row['remark'],
"postingDate" => $row['postingDate']
);
$Pdata = $picture;
}`enter code here`
echo json_encode($Pdata);


Here I am sending my data to ajax calls in JSON format. But not able to see data at HTML page.










share|improve this question
















function pendingorder(){

app.request({
type:"POST",
url: "pages/getpeningorer.php",
dataType: 'json',
cache: false,
success:function(data) {
console.log(data);
var result = $.parseJSON(data);
$.each(result, function(key, value){
$.each(value, function(k, v){
if(k === "order_id"){
$("#pendingtable >tbody:last").append(
$('<tr>').append(
$('<td>').append(v)
.append(
$('</td>').append(
$('</tr>')
)
)
)
);
}
if(k === "product_id"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "status"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

if(k === "remark"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}
if(k === "postingDate"){
$("#demoTable >tbody >tr:last").append(

$('<td>').append(v)
.append(
$('</td>')

)

);
}

});
});
console.log(data);}
});
console.log('execute success');
}

I AM trying to call ajax through function....But not working. In a similar way, I post data it is working.


PHP code:



enter code here



$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);

if (mysqli_connect_error()) {
die('Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
} else {
$sql = "SELECT order_id,product_id,status,remark,postingDate FROM order_track_history where status='In process'";
$result = $conn->query($sql);
}
$Pdata = array();
while ($row = mysql_fetch_array($result)) {
$picture = array(
"order_id" => $row['order_id'],
"product_id" => $row['product_id'],
"status" => $row['status'],
"remark" => $row['remark'],
"postingDate" => $row['postingDate']
);
$Pdata = $picture;
}`enter code here`
echo json_encode($Pdata);


Here I am sending my data to ajax calls in JSON format. But not able to see data at HTML page.







jquery mysql ajax html-framework-7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 '18 at 5:33









Suresh Kamrushi

11k95772




11k95772










asked Nov 29 '18 at 5:32









MANDAR MAHADEOKARMANDAR MAHADEOKAR

63




63













  • have you tried console.log the data return by your php script?

    – Buddy
    Nov 29 '18 at 5:37











  • not getting data also in console

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 5:38











  • if you access this page pages/getpeningorer.php direct from browser, what is result will you got?

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:44











  • -- also make sure you are enable error in php.ini or set this code in your php file error_reporting(E_ALL); ini_set('display_errors', 1);

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:49











  • work after setting var result = $.parseJSON(data); to var result = data;

    – MANDAR MAHADEOKAR
    Dec 3 '18 at 8:57





















  • have you tried console.log the data return by your php script?

    – Buddy
    Nov 29 '18 at 5:37











  • not getting data also in console

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 5:38











  • if you access this page pages/getpeningorer.php direct from browser, what is result will you got?

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:44











  • -- also make sure you are enable error in php.ini or set this code in your php file error_reporting(E_ALL); ini_set('display_errors', 1);

    – Anees Hikmat Abu Hmiad
    Nov 29 '18 at 14:49











  • work after setting var result = $.parseJSON(data); to var result = data;

    – MANDAR MAHADEOKAR
    Dec 3 '18 at 8:57



















have you tried console.log the data return by your php script?

– Buddy
Nov 29 '18 at 5:37





have you tried console.log the data return by your php script?

– Buddy
Nov 29 '18 at 5:37













not getting data also in console

– MANDAR MAHADEOKAR
Nov 29 '18 at 5:38





not getting data also in console

– MANDAR MAHADEOKAR
Nov 29 '18 at 5:38













if you access this page pages/getpeningorer.php direct from browser, what is result will you got?

– Anees Hikmat Abu Hmiad
Nov 29 '18 at 14:44





if you access this page pages/getpeningorer.php direct from browser, what is result will you got?

– Anees Hikmat Abu Hmiad
Nov 29 '18 at 14:44













-- also make sure you are enable error in php.ini or set this code in your php file error_reporting(E_ALL); ini_set('display_errors', 1);

– Anees Hikmat Abu Hmiad
Nov 29 '18 at 14:49





-- also make sure you are enable error in php.ini or set this code in your php file error_reporting(E_ALL); ini_set('display_errors', 1);

– Anees Hikmat Abu Hmiad
Nov 29 '18 at 14:49













work after setting var result = $.parseJSON(data); to var result = data;

– MANDAR MAHADEOKAR
Dec 3 '18 at 8:57







work after setting var result = $.parseJSON(data); to var result = data;

– MANDAR MAHADEOKAR
Dec 3 '18 at 8:57














1 Answer
1






active

oldest

votes


















0














it seems like there's something wrong with your php codes, try this code instead



$row = mysql_fetch_array($result);
foreach($row as $r) {
$picture = array(
"order_id" => $r['order_id'],
"product_id" => $r['product_id'],
"status" => $r['status'],
"remark" => $r['remark'],
"postingDate" => $r['postingDate']
);
}





share|improve this answer
























  • still Not working

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 6:08












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53532454%2fnot-able-to-get-php-parsed-data-in-framework7-through-ajax-call%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














it seems like there's something wrong with your php codes, try this code instead



$row = mysql_fetch_array($result);
foreach($row as $r) {
$picture = array(
"order_id" => $r['order_id'],
"product_id" => $r['product_id'],
"status" => $r['status'],
"remark" => $r['remark'],
"postingDate" => $r['postingDate']
);
}





share|improve this answer
























  • still Not working

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 6:08
















0














it seems like there's something wrong with your php codes, try this code instead



$row = mysql_fetch_array($result);
foreach($row as $r) {
$picture = array(
"order_id" => $r['order_id'],
"product_id" => $r['product_id'],
"status" => $r['status'],
"remark" => $r['remark'],
"postingDate" => $r['postingDate']
);
}





share|improve this answer
























  • still Not working

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 6:08














0












0








0







it seems like there's something wrong with your php codes, try this code instead



$row = mysql_fetch_array($result);
foreach($row as $r) {
$picture = array(
"order_id" => $r['order_id'],
"product_id" => $r['product_id'],
"status" => $r['status'],
"remark" => $r['remark'],
"postingDate" => $r['postingDate']
);
}





share|improve this answer













it seems like there's something wrong with your php codes, try this code instead



$row = mysql_fetch_array($result);
foreach($row as $r) {
$picture = array(
"order_id" => $r['order_id'],
"product_id" => $r['product_id'],
"status" => $r['status'],
"remark" => $r['remark'],
"postingDate" => $r['postingDate']
);
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 29 '18 at 5:46









BuddyBuddy

767




767













  • still Not working

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 6:08



















  • still Not working

    – MANDAR MAHADEOKAR
    Nov 29 '18 at 6:08

















still Not working

– MANDAR MAHADEOKAR
Nov 29 '18 at 6:08





still Not working

– MANDAR MAHADEOKAR
Nov 29 '18 at 6:08




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53532454%2fnot-able-to-get-php-parsed-data-in-framework7-through-ajax-call%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Lallio

Unable to find Lightning Node

Futebolista