Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [undefined-index]

An index is undefined if it is not part of the array being accessed. Use this tag for questions regarding behaviour of undefined indexes or when you see undefined indexes where you don't expect them.

undefined-index
0 votes
1 answer
47 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 ...
Ben's user avatar
  • 53
0 votes
0 answers
41 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) { $...
Singleton's user avatar
  • 113
2 votes
0 answers
235 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($...
Azima's user avatar
  • 4,043
0 votes
0 answers
37 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 ...
DIPANKAR CHOWDHURY's user avatar
0 votes
1 answer
118 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: ...
nacklicious's user avatar
0 votes
1 answer
771 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 ...
Darwin Arugay's user avatar
0 votes
1 answer
1k 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 ...
Conlaodh Quinn's user avatar
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", ...
Timothy's user avatar
  • 77
-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....
Ooker's user avatar
  • 2,635
0 votes
1 answer
279 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 ...
lky's user avatar
  • 1,119
0 votes
1 answer
446 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 = {'...
joker_007's user avatar
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: ...
Iam-kelvin's user avatar
0 votes
1 answer
536 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)...
Gaenox L's user avatar
0 votes
3 answers
631 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->...
Code Lover's user avatar
  • 8,318
0 votes
0 answers
18 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 ...
Sajedul Noman's user avatar

15 30 50 per page
1
2 3 4 5
19