Have a good day:)
I tried to insert the value via ajax to php but I receive the error (as mentioned yellow highlighting part),kinldy help me to clear this.
- "stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
- "stylesheet" href="bootstrap.min.css" />
- class="container">
"right" style="margin-bottom:5px;">- name="add" id="add" class="btn btn-success btn-xs">Add
- id="user_form">
class="table-responsive">class="table table-striped table-bordered" id="user_data">
First Name Last Name Details Remove "center">- "submit" name="insert" id="insert" class="btn btn-primary" value="Insert" />
- "user_dialog" title="Add Data">class="form-group">
- "text" name="first_name" id="first_name" class="form-control" />
- "error_first_name" class="text-danger">
class="form-group">- "text" name="last_name" id="last_name" class="form-control" />
- "error_last_name" class="text-danger">
class="form-group" align="center">- "hidden" name="row_id" id="hidden_row_id" />
- name="save" id="save" class="btn btn-info">Save
- "action_alert" title="Action">
- require_once "dbconnect.php";
- //$query = "INSERT INTO internship (first_name, last_name) VALUES (:first_name, :last_name)";
- for($count = 0; $count<count($_POST['hidden_first_name']); $count++)
- {
- $data = array
- (
- $first_name=$_POST['hidden_first_name'][$count],
- $last_name=$_POST['hidden_last_name'][$count]
- );
- if($first_name!='')
- {
- echo "HI".$first_name;
- echo $last_name;
- $result1=$link->query("INSERT INTO internship(`first_name`, `last_name`) VALUES (`$first_name`, `$last_name`)");
- $result1->bind_param('i', $first_name); // error here
- $result1->execute();
- if ($result1)
- {
- echo "Successfully";
- }
- else
- {
- echo "Failed";
- }
- /* $statement = $link->prepare("INSERT INTO internship (`id`,`first_name`, `last_name`) VALUES (``,`$first_name`, `$last_name`)");
- //$statement->bind_param("s", $hidden_first_name);
- $result = $statement->execute(); */
- }
- else
- {
- echo "I dont know you.";
- }
- }
karthika pommuduPosted Jul 22, 2020, 3:15 AM
Roshan RathodPosted Jul 22, 2020, 2:16 AM
karthika pommuduPosted Jul 22, 2020, 2:08 AM
Roshan RathodPosted Jul 22, 2020, 1:19 AM