What's new

Welcome to xCrud Community - Data Management and extended PHP CRUD

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

DB query pass field variable

andyrav

New member
Joined
Mar 19, 2023
Messages
27
Reaction score
0
Points
1
Location
Uk
Hi
When doing another db query for a downdown select, is it possible to pass a value of a field on that row
basicly on the drop down i only want to select what that user is able to view


thanks
 

DaDo

Administrator
Staff member
Joined
Dec 1, 2021
Messages
108
Reaction score
23
Points
18
I can't understand what you need please explain
 

DaDo

Administrator
Staff member
Joined
Dec 1, 2021
Messages
108
Reaction score
23
Points
18
you have possibility to do this :

Example 1
$xcrud->fields('id','field_relation','field_dropdown');
$xcrud->relation('field_dropdown','table_dropdown','id_relation','field_value',array('data_array' => {field_relation}));
Example 2
$xcrud->set_attr('field_dropdown',array('id'=>'dropdown_ajax','data-relation-value'=>'{field_relation}'));
and after this you can use Ajax mode to call id and value and manage dropdown using Ajax using attr you can pass #dropdown_ajax to jQuery or javascript
 

DaDo

Administrator
Staff member
Joined
Dec 1, 2021
Messages
108
Reaction score
23
Points
18
$SbWBFlZsf->relation('newnumber','bw_numbers','groupid','number',array('groupid' => {????}));
just stuck on how to pass a value from that row to where the ??? is


I can't understand exactly what you want to do
can you share your table mysql please
 

andyrav

New member
Joined
Mar 19, 2023
Messages
27
Reaction score
0
Points
1
Location
Uk
resolved with ' '
$xcrud->relation('field_dropdown','table_dropdown','id_relation','field_value',array('data_array' => '{field_relation}' ));

thanks
 
Top Bottom