Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I need to know the problem in line number 18. what is the problem?

What I have tried:

PHP
$columnsNotEmpty = [];
    $count = 0;
    foreach ($data as $key => $row) {
        if ($count == 0 && $isTopHeaderFrozen) {
            $count++;
            continue;
        }

        foreach ($row as $key2 => $col) {
            if (!empty($col) && !in_array($key2, $columnsNotEmpty)) {
                array_push($columnsNotEmpty, $key2);
            }
        }

        $count++;
    }

    foreach ($data as $key => $row) {
        foreach ($row as $key2 => $col) {
            if (!in_array($key2, $columnsNotEmpty)) {
                unset($data[$key][$key2]);
            }
        }   
    }
Posted
Updated 10-Aug-18 1:55am
v2
Comments
OriginalGriff 10-Aug-18 6:38am    
Good question.
Here are some others for you:
1) Which one is line number 18?
2) When do you get the error?
3) What message(s) do you get?
4) What did you do to get the problem?
5) What do you expect that code to do?
6) What does it do that you didn't expect, or not do that you did?
7) What have you tried to try and work out why?

We can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.
Member 13944847 10-Aug-18 6:58am    
It was about my database.
I tried it for that column which I need to insert data.
if there need to replace any data in the column then it will be store in the column and previous will remove.
OriginalGriff 10-Aug-18 7:09am    
Read the questions I asked, and stop being vague! Typing as little as possible may get your question posted quickly, but it doesn't get it answered quickly - "it was about my database" means nothing to us as we have no idea what you are trying to do, or even where a database might be involved!

Think about it: what you have done so far is break down in the middle of nowhere, phone the garage, and say "It broke". When they ask "what broke, where are you, what car is it, who are you, what do you want from us?" you've now said "it's a Ford" and put the phone down. How long do you think it will be before the garage arrives with the right part to fix your car?

Help us to help you!
Eric Lynch 10-Aug-18 9:17am    
I wish I could upvote a comment :)
OriginalGriff 10-Aug-18 10:00am    
:D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900