02-20-2020, 02:31 PM
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.
Above is the simple form I have to get the ID
And below is the function which checks the value
For some reason which I just cannot understand the $record['EventID'] does not match the $eventid!? I have no clue why. This SHOULD match. I KNOW the EventID does exist in a record, I have seen it in the records. the ID is 4683. Even if I put "4683" instead of $eventid, there is no match. I have been sitting for over an hour trying to figure out why this is not matching even with the hard coded value instead of $eventid. And as I said I know the ID exists I can see it in the records.
I would be very gratefull if anyone have any ideas as to why this happening?
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">
<div class="row" style="margin-top: 20px;">
<div class="col-md-2">
<label style="font-size: 20px;">Event ID: </label>
</div>
<div class="col-md-6">
<input type="text" class="form-control" name="eventid" placeholder="Enter the ID for the Event">
</div>
<input type="submit" name="getevent" value="Search">
</div>
</form>
And below is the function which checks the value
Code:
public function searchevent() {
$data = array();
$eventid = $this->input->post('eventid');
$dbname = $this->session->userdata("dbname");
$this->db->db_select($dbname);
$events = $this->callAPI('eventlist');
foreach ($events['Records']['Record'] as $record) {
if ($record['EventID'] == $eventid) {
$fields = array(
'displayname' => array(
'type' => 'VARCHAR',
'constraint' => 255,
'null' => FALSE
),
..... cut off for brevity
I would be very gratefull if anyone have any ideas as to why this happening?