273 questions
0 votes
1 answer
58 views
When building an array from an array: IF var is SET, INCREMENT else SET to 1
Hi i've tried many solutions, but can't find what i'm after. I'm building an array from a number of other arrays, I could do something like this: isset($setinc) ? $setinc++ : $setinc=1; However when ...
0 votes
0 answers
47 views
Variable that's being passed with an empty string and causing an undefined index issue in my logs
I know this is quite a common question but hopefully someone can provide some help for me. /** * @param $optionid * @return mixed */ public function getAttributeSwatchHashcode($optionid) { $...
2 votes
0 answers
261 views
php undefined index or variables don't throw any error
I came across a fat-free framework where indexes are accessed without checking if there's data present or not. few e.g. e.g.1 $sObj = new Site($db); // this returns null? $site = $sObj->getById($...
0 votes
0 answers
55 views
Error after clicking submit button in CRUD application in PHP
I have made a CRUD application. Every operation works well but update operation gives error. This is index.php index.php` This is update.php update.php This is the home page: This is after clicking ...
0 votes
1 answer
122 views
PHP - Undefined index solving returns warining
I have a function within my PHP project which has some specific params.. $user_sequence = $user['user_sequence']; if ($cached || !$user_sequence) { return; } Notice: Undefined index: ...
0 votes
1 answer
813 views
After successfully adding data, upon scrolling an item was removed
I am using react-table with react-window-infinite-loader and react-window for infinite scrolling. Initially the table has 20 items(data) on fetch from API. After adding a new data into my table it ...
0 votes
1 answer
2k views
Updating table using form with AJAX
I am new to Laravel and I am trying to update a table of data using an Ajax call. The 'rent' field in the table should be the only field that can be edited, but I have been unable to get the changes ...
0 votes
1 answer
2k views
Want to Get data from Api (json form) in blade file Laravel
This is the API that I want to get data from it "meals": [ { "idMeal": "52770", "strMeal": "Spaghetti Bolognese", ...
-1 votes
1 answer
2k views
Getting undefined index when retrieving json value of key name having a dot within in PHP [duplicate]
My JSON file has this structure: [ { "n.name": "name1", "n.section": ["section1"] }, { "n.name": "name2", "n....
0 votes
1 answer
349 views
Why am I throw an error for undefined index when I'm checking whether it's empty?
I've got the following error: ErrorException: Undefined array key 0 in /Users/User/Sites/Site/app/Jobs/MigrateData.php:67 This is correct in the one instance for my Job, the $this->schools is an ...
0 votes
1 answer
576 views
How can I post data to php and print that data?
I tried requests module but I've error in my php outputs: The error is: Notice: Undefined index: firstname in D:\xampp\htdocs\myfile\receive.php on line 7 NULL code in python: ''' payload = {'...
1 vote
1 answer
2k views
Laravel 8: Undefined index
I'm working on a questionnaire project and I ran into an error saying: Undefined index: exams This happened when I was trying to store responses to my database. Here is my controller code: ...
0 votes
1 answer
627 views
Adding an array of numbers in JS gets undefined because array doesn't accept variable to pick a value
Code function Taxes(taxRate, purchases) { let total = 0; console.log(purchases); for (let i = 0; i <= purchases.length; i++) { total += purchases[i]; } console.log(total)...
0 votes
3 answers
697 views
php foreach loop undefined property / index notice while setting value to stdclass property or array variable
In foreach loop, I am trying to add some additional property for the source array or objects. That gives me the following notice. Notice: Undefined property: stdClass::$total foreach ($this->...
0 votes
0 answers
20 views
getting undefined index in php when sending data from ajax [duplicate]
I need to send ajax data to the PHP POST method, but I get undefined index "name". I have tried including dataType: json in ajax and json_encode(). In console, I am getting the whole HTML ...