Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- ini_set('display_errors', 'On');
- include '../../../dbconfig.php';
- $array1= [];
- $array2= [];
- try
- {
- $stmt = $db_con->prepare("SELECT * FROM myTable");
- $stmt->execute();
- if($stmt->rowCount() > 0){
- $array1['success']=true;
- $array2 = $stmt->fetchAll();
- $result=array_merge($array1, $array2);
- var_dump(count($result));
- //echo json_encode($result);
- exit;
- }else{
- $result=[];
- $result['success']=false;
- $result['error_msg']="table not found";
- echo json_encode($result);
- exit;
- }
- }catch(PDOException $e){
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement