This is what I am doing. I am getting an error as in the end of this post.
[LEFT][SIZE=13px]I am sorry to disturb with a PM. But I need help . I am trying to develop a rest api in scriptcase. [/SIZE][/LEFT]
[LEFT][SIZE=13px]One I developed using a guidance on the forum it is working fine. But now I want to send parameter. And the same has to be bound. I am getting error that binding parameter is not done. My scriptcase code as follows[/SIZE][/LEFT]
[LEFT][SIZE=13px]header(“Access-Control-Allow-Origin: *”);[/SIZE][/LEFT]
[LEFT][SIZE=13px]header(“Access-Control-Allow-Headers: access”);[/SIZE][/LEFT]
[LEFT][SIZE=13px]header(“Access-Control-Allow-Methods: GET”);[/SIZE][/LEFT]
[LEFT][SIZE=13px]header(“Access-Control-Allow-Credentials: true”);[/SIZE][/LEFT]
[LEFT][SIZE=13px]header(‘Content-Type: application/json’);[/SIZE][/LEFT]
[LEFT][SIZE=13px]// SQL statement parameters[/SIZE][/LEFT]
[LEFT][SIZE=13px]$check_table = ‘products’; // Table name[/SIZE][/LEFT]
[LEFT][SIZE=13px]$check_where = “id = ?”; // Where clause[/SIZE][/LEFT]
[LEFT][SIZE=13px]// Check for record[/SIZE][/LEFT]
[LEFT][SIZE=13px]$check_sql = ‘SELECT *’[/SIZE][/LEFT]
[LEFT][SIZE=13px] . ’ FROM ’ . $check_table[/SIZE][/LEFT]
[LEFT][SIZE=13px] . ’ WHERE ’ . $check_where;[/SIZE][/LEFT]
[LEFT][SIZE=13px]//$check_sql = ‘SELECT * from products where id = 60’;[/SIZE][/LEFT]
[LEFT][SIZE=13px]//$check_sql->bindParam(1, $this->id);[/SIZE][/LEFT]
[LEFT][SIZE=13px]sc_select(rs, $check_sql);[/SIZE][/LEFT]
[LEFT][SIZE=13px]if (false == {rs})[/SIZE][/LEFT]
[LEFT][SIZE=13px]{[/SIZE][/LEFT]
[LEFT][SIZE=13px] // Error while accessing database[/SIZE][/LEFT]
[LEFT][SIZE=13px] http_response_code(404);[/SIZE][/LEFT]
[LEFT][SIZE=13px] echo json_encode(array(‘message’ => ‘Error while accessing database.’));[/SIZE][/LEFT]
[LEFT][SIZE=13px] [/SIZE][/LEFT]
[LEFT][SIZE=13px]}[/SIZE][/LEFT]
[LEFT][SIZE=13px]elseif ({rs}->EOF)[/SIZE][/LEFT]
[LEFT][SIZE=13px]{[/SIZE][/LEFT]
[LEFT][SIZE=13px] // No record found[/SIZE][/LEFT]
[LEFT][SIZE=13px] http_response_code(404);[/SIZE][/LEFT]
[LEFT][SIZE=13px] echo json_encode(array(‘message’ => ‘No Record Found.’));[/SIZE][/LEFT]
[LEFT][SIZE=13px]}[/SIZE][/LEFT]
[LEFT][SIZE=13px]else[/SIZE][/LEFT]
[LEFT][SIZE=13px]{[/SIZE][/LEFT]
[LEFT][SIZE=13px] $rs->MoveFirst();[/SIZE][/LEFT]
[LEFT][SIZE=13px] $id = $rs->fields[0];[/SIZE][/LEFT]
[LEFT][SIZE=13px] $name=$rs->fields[1];[/SIZE][/LEFT]
[LEFT][SIZE=13px] $description=$rs->fields[2];[/SIZE][/LEFT]
[LEFT][SIZE=13px] $price=$rs->fields[3];[/SIZE][/LEFT]
[LEFT][SIZE=13px] $category_id=$rs->fields[4];[/SIZE][/LEFT]
[LEFT][SIZE=13px] $category_name = $rs->fields[5];[/SIZE][/LEFT]
[LEFT][SIZE=13px] $post_item = array([/SIZE][/LEFT]
[LEFT][SIZE=13px] “id” => $id,[/SIZE][/LEFT]
[LEFT][SIZE=13px] “name” => $name,[/SIZE][/LEFT]
[LEFT][SIZE=13px] “description” => html_entity_decode($description),[/SIZE][/LEFT]
[LEFT][SIZE=13px] “price” => $price,[/SIZE][/LEFT]
[LEFT][SIZE=13px] “category_id” => $category_id,[/SIZE][/LEFT]
[LEFT][SIZE=13px] “category_name” => $category_name[/SIZE][/LEFT]
[LEFT][SIZE=13px] );[/SIZE][/LEFT]
[LEFT][SIZE=13px] http_response_code(200);[/SIZE][/LEFT]
[LEFT][SIZE=13px] echo json_encode($post_item);[/SIZE][/LEFT]
[LEFT][SIZE=13px]}[/SIZE][/LEFT]
[LEFT][SIZE=13px]Error returned [/SIZE][/LEFT][LEFT]<TD class=“scErrorMessage” align=“center”>PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: no parameters were bound</TD>[/LEFT]