Here is what is going on. I have an error in my Ajax code that is causing the following error: Unexpected end of JSON input ajax Here is my code: I’m getting data from an array by doing the following: Then I’m parsing the JSON by doing the following: Based on the code, what could be causing the is…
Tag: php
Larave conditional aggregation to get multiple sum of amount
Hope all is well. Anyone can tell me how can I get to run this SQL query in a the right way in Laravel? Controller: $data=DB::raw(“SELECT name as ‘name’ FROM invoices WHERE country=’$country’…
How do I get data from another table in MySQL?
I’m currently trying to link some databases up for a project I’m working on for my business. Here’s my below SQL I’m using for my PHP website. At the moment my output goes like this to show what’s in each row using e.g. $lname=$lname[“variable”] I have another “…
Adding Custom Footer to page Template
I have made a custom footer layout using “dummy” content to start with. This is the footer html To get this to display on the bottom of my last “scrolling section” (#contact) I have added this html footer to : page-templates/template-full-page.php However my footer is not displaying at…
How to print infinity nested categories in dropdown (select) menu in Laravel
I have this category table: id name parent_id 1 Programming 0 2 History 0 3 PHP 1 4 Javascript 1 6 World history 2 7 jQuery 4 8 AJAX 4 9 Europe 6 10 American 6 16 ajax nested 8 Here is how I get categories in controller: And Model Category: I want to output categories, like this: Which looks
Empty cart button on woocommerce cart page does not work properly
I’m using this code to creare a button on my woocommerce cart page (near the update cart button): The problem is that it works only by clicking two times. I think that the problem could be that I’m using this link to add a product to the cart: Any idea how to solve this? Answer The problem lies in…
Laravel only one friend_id per user
I’m only starting with laravel and was wondering if anyone could help, I’ve created a friend_id and user_id from the database and have made a form in the view that adds the user_id to the friend_id (not sure what the terminology is for anything yet XD) everything working fine but each time I press…
Create array from DOM node values in PHP
I’m trying to create an array of amazon product variants using DOM php, My desired array should look like; Here is my code: Though my code is working but there are some mistakes in code and it might wont work for all amazon products. so I need suggestions and improvement. and also my output is a json ob…
Data from an Parser is storing 2x the same data instead of 1x some data and the other 1x the other data
I’ve made a parser and it’s supposed to take data from 2 pages in a webshop and save those data but it’s now only saving the data from 1 page two times instead of the data from both the pages each one time. Can someone figure out why only the second page’s data is saved instead of both…
PHP trying to simply a repetitive script involving rowsets
I’m trying to simplify a repetitive script that I’m doing in PHP. I’ve looked at a few loop options but since it involves rowsets being returned from a MySQL stored procedure it’s not acting properly. I’m doing this same script about 15 times to return all the data. Ultimately I&…