Post Value Not Matching |
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?
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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.
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.
(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.
Then my next suggested debug idea is
PHP Code: foreach ($events['Records']['Record'] as $record)
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: // ----------------------------------------------------------------------- What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
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. |
Welcome Guest, Not a member yet? Register Sign In |