Welcome Guest, Not a member yet? Register   Sign In
RE:[help!!!] A PHP Error was encountered
#21

[eluser]WebsiteDuck[/eluser]
Try changing this
Code:
$rows = $this->input->post("row0");
to this
Code:
$rows = array($this->input->post("row0"));
#22

[eluser]maria clara[/eluser]
i tried it but it shows this error in my console.
Code:
<p>Severity: Notice</p>
<p>Message:  Undefined variable: rows</p>
<p>Filename: models/ccm_receipt_db.php</p>
<p>Line Number: 312</p>

<p>Severity: Notice</p>
<p>Message:  Undefined offset:  7</p>
<p>Filename: models/ccm_receipt_db.php</p>
<p>Line Number: 315</p>
#23

[eluser]Dyllon[/eluser]
[quote author="WebsiteDuck" date="1263302097"]Try changing this
Code:
$rows = $this->input->post("row0");
to this
Code:
$rows = array($this->input->post("row0"));
[/quote]

Honestly I don't think this is the right answer, it's slapping a band-aid on a much larger issue.

I don't mean to be harsh but if you don't know where your variable is coming from, why it's an empty array, why it's not an array at all, or why it's not even a variable I think it's time to take a step back.

Handling arrays and knowing how to use basic built-in php functions are very basic skills.

Take some time to learn more of the basics of php, read articles, tutorials, and books.
There are thousands of free php tutorials on the internet and php.net has great documentation and user submitted examples.

Code readability and naming conventions are also very important, especially when asking other developers to review your code.
If it's hard to read or the variable names don't make sense people are less likely to read through it and try to help.
#24

[eluser]Ben Edmunds[/eluser]
Hey,

I ditto what Dyllon said but I also understand that you're a student and trying to figure this out.

What you need to do is find where you are calling save_detail(), not where it is being created but where it is being called. And then verify that you are passing valid variables and arrays through to save_details().


Hope that helps Kahtrina!
#25

[eluser]maria clara[/eluser]
hi,

thanks for that. im really having a hard time figuring that out because im not the one who really made this.
That's why im also seeking for the codes if i had encountered an error. im just helping to enhance this CI-project.

hope you understand,

regards,
maria
#26

[eluser]Ben Edmunds[/eluser]
Hey,

I understand completely. Did you ever track down the save_details() issue?
#27

[eluser]maria clara[/eluser]
hi,

thanks, i am still tracking it.and im asking my colleagues here. im just finishing the replacement of the flexigrid design of all the tables. then i will track that issue.

Code:
function getDetails($data)
    {
        $data['ccm_receipt.is_deleted'] = '0';
        $this->db->join('maint_customers b','ccm_receipt.client_id = b.cust_id','left');
        $this->db->join('sec_dataset c','ccm_receipt.status = c.data_value AND c.data_code = "TRAN_STATUS"','left');
        $this->db->select("ccm_receipt.*,
                            b.customer_code, b.customer_name,
                            c.data_display as status_name
                            ");
        $this->db->where($data);
        return $this->db->get('ccm_receipt')->row_array();
    }

the tables are joined so im having a hard time finding the right function where the save_details() was being called.




Theme © iAndrew 2016 - Forum software by © MyBB