mevdschee / php-crud-ui

Single file PHP script that adds a UI to a PHP-CRUD-API project
MIT License
123 stars 55 forks source link

Listing referenced texts #22

Closed anushaath closed 7 years ago

anushaath commented 7 years ago

I want to show only certain values of certain columns if the field is referenced.

So after the if statement in line 92 I added another if statement like this:

https://github.com/mevdschee/php-crud-ui/blob/master/ui.php#L92

if ($i=='first_name' || $i=='last_name' || $i=='model' || $i=='reg_number'||$i=='pickup_location' || $i=='start_time')

This should ideally print "Firstname- Lastname" for one table. But it prints nothing. The field is blank. I can't seem to figure it out. If I remove the above if statement, it prints everything. Any ideas?

mevdschee commented 7 years ago

Variable $i represents the column number, not the column name.

Use: $data[$subject]['columns'][$i]=='first_name'