TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
karthika pommudu
NA
321
35k
Unable to get the ajax response value
May 13 2020 4:29 AM
function
getform()
{
var
c_name = $(
'#dropdownid'
).val();
var
c_id = $(
'#src5'
).val();
var
c_date = $(
'#c_date'
).val();
var
result={
"c_name"
:c_name,
"c_id"
:c_id,
"c_date"
:c_date};
$.ajax({
url:
"cont_get.php"
,
type:
"POST"
,
data: {
"c_name"
: c_name,
"c_id"
:c_id,
"c_date"
:c_date},
success:
function
() {
console.log(
'Updated'
);
},
error:
function
(err)
{
console.log(err);
}
});
}
File name: cont_get.php
Need help to clear the issue! Once i run this php file its shown else statement "error" msg only.
<?php
require_once
"dbconnect.php"
;
//echo '1';
if
(isset($_POST[
'c_id'
])&& ($_POST[
'c_date'
])&& ($_POST[
'c_name'
]))
{
echo
'5'
;
$c_name = $_POST[
'c_name'
];
$c_id =$_POST[
'c_id'
];
$c_date =$_POST[
'c_date'
];
//$current = date('d-m-Y');
//$date = strtotime($current);
$result1=$link->query(
"UPDATE feedback SET c_name='$c_name',last_date='$c_date' WHERE id = '$c_id'"
);
$result1->bind_param(
'i'
, $c_id);
$result1->execute();
if
($result1)
{
print
"Successfully"
;
}
else
{
print
"Failed"
;
}
}
else
{
echo
'error'
;
}
?>
Reply
Answers (
3
)
PHP Fatal error: Out of memory
Storing database of an HTML form