Category : json

I have no ajax response, the script is running fine but it remains on the php controller blank page can help me thank you. the form to be executed is inside a php loopa unique id. here is the java part $(document).ready(function(){ $(‘.sendDelete’).on(‘click’, function () { var id = $(this).attr("data-id"); $("#idEnter").html( id ); $(‘#modalDelete’).modal(‘show’); $(document).on(‘click’, ..

Read more

I have problem, I have in database 2 projects in each project have videos, I faced an issue that the code only retrieve videos for 1 project query(“SELECT * FROM projects”) or die($GLOBALS[‘DB’]->error()); if($GLOBALS[‘DB’]->num_rows($projects) >= 1){ $rowProject = $GLOBALS[‘DB’]->fetch_object($projects) or die($GLOBALS[‘DB’]->error()); ?> <div class="row"> <?php $videosJson = json_decode($rowProject->project_videos); $projectName = $rowProject->project_name; if($videosJson != null) { ..

Read more

I’m trying to get JSON from a URL using the codes below. I always get the errors below. <?php $url = …; $json = file_get_contents($url); $dados = json_decode($json, true); echo "<pre>"; print_r($dados); ?> Error: Warning: file_get_contents(https://www.car.gov.br/publico/imoveis/getImovel?lat=-2.449376438504347&lng=-49.04754638759188): Failed to open stream: Redirection limit reached, aborting in … on line 5 Another code used: <?php $url = ..

Read more

I’m trying to fill a list with the output from a mysql query. I can deliver 1 item but not more. PHP code: (‘fetchBooks.php’) $con = mysqli_connect(HOST,USERNAME,PASSWORD,DB); $brand = $_GET[‘brand’]; $res = mysqli_query($con, "CALL GetBooks(‘$brand’)"); $result = array(); while($row = mysqli_fetch_array($res)){ array_push($result, array(‘brand’=>$row[0])); } echo json_encode(array(‘result’=>$result)); Javascript code: $.getJSON( ‘fetchBooks.php’, ‘brand=’+ brand, function(result){ const olEle ..

Read more

I’m sure I must be missing something obvious but I am trying to access some venue and category information from the below data and retrieve it using PHP. When I include [‘venues’] next to [‘response’] in my foreach statement, I can access the name, latitude and longitude easily, no issues. However, I need to access ..

Read more

I want to split numbers and strings seperately in separate [] to plot the morries chart. I am getting the array in this format ["1970 Jan","1970 Jan","1970 Jan","1970 Jan","2017 Apr","2017 Apr","2017 Apr","2017 Apr","2017 Apr","2017 Jun","2017 Aug","2017 Aug","2018 Jan","2018 Feb","2018 Mar","2019 Feb","2020 Apr","2020 Jul","2020 Aug","2020 Aug","2021 Jan"] . I want to the numbers like ["1970", "1970", ..

Read more