Post Value Not Matching - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Post Value Not Matching (/showthread.php?tid=75555) |
Post Value Not Matching - GregS - 02-20-2020 Hello I seem to be having a problem which I just cannot understand. I have 1 text input I am using to get an ID for an Event. For some reason which I just cannot understand, the value is not matching. Code: <form action="searchevent" method="post"> And below is the function which checks the value Code: public function searchevent() { I would be very gratefull if anyone have any ideas as to why this happening? RE: Post Value Not Matching - InsiteFX - 02-20-2020 Is the EventID in the record numeric or varchar? Sounds like a character miss-match to me. Make sure that the recoed EventID and the $eventid are both the same type numeric or string. RE: Post Value Not Matching - GregS - 02-20-2020 (02-20-2020, 04:50 PM)InsiteFX Wrote: Is the EventID in the record numeric or varchar? Sounds like a character miss-match to me. Hi! Thanks for trying to help. I thought the same initially as well They are both strings. But even if I try: Quote:if ($record['EventID'] == 4683) or Code: if ($record['EventID'] == "4683") Here is the a sample of the record: Code: "Date": "23-02-2020 00:00:00", That is why I say the record does exist. RE: Post Value Not Matching - dave friend - 02-21-2020 The data may be in the database but is the call to $this->callAPI('eventlist') returning that record? Try adding var_dump($events) after the $this->callAPI('eventlist'); call and see what you are actually working with. RE: Post Value Not Matching - GregS - 02-22-2020 (02-21-2020, 02:32 PM)dave friend Wrote: The data may be in the database but is the call to $this->callAPI('eventlist') returning that record? Try adding var_dump($events) after the $this->callAPI('eventlist'); call and see what you are actually working with. Hi Dave. I have done a var dump and can see the call is returning the record and it a string. RE: Post Value Not Matching - dave friend - 02-22-2020 Then my next suggested debug idea is PHP Code: foreach ($events['Records']['Record'] as $record) RE: Post Value Not Matching - InsiteFX - 02-22-2020 Here is a nice var_debug helper method to format the output, just place the code into your own helper load and call it. PHP Code: // ----------------------------------------------------------------------- RE: Post Value Not Matching - GregS - 02-27-2020 Hello I apologize for the late reply, work has been crazy lately. I have done a var dump and I can see that record with the correct ID is in the Records that are returned. I have attached a TXT file that contains the var_dump. |