Schließen Sie die Abfrage mit mit Kommas getrennten Werten in Codesigniter anPhp

PHP-Programmierer chatten hier
Anonymous
 Schließen Sie die Abfrage mit mit Kommas getrennten Werten in Codesigniter an

Post by Anonymous »

Ich habe eine Tabellenstruktur wie < /p>

Table Name : crm_mrdetails

id | mr_name | me_email | mr_mobile | mr_doctor|
-------------------------------------------------
1 | John |abc@gmail.com | 9876543210 | 1,2 |

Table Name : crm_mr_doctor

id | dr_name | specialization| product |
--------------------------------------------
1 | Abhishek | cordiologist | 1,2 |
2 | Krishnan | Physician |2,4,5 |

Table Name: crm_product

id | product_name | unit| pts |
--------------------------------
1 | Crocin | 50 | 50 |
2 | Crocin2 | 60 | 100 |
3 | Crocin3 | 30 | 90 |
4 | Crocin4 | 70 | 80 |
5 | Crocin5 | 80 | 50 |
< /code>

Ich muss Daten aus "crm_mrdetails" -Tabelle und der Join -Tabelle "crm_mr_doctor" und "crm_product" abrufen, verbinden Sie die Bedingung wie < /p>

crm_mrdetails.mr_doctor = crm_mr_doctor.id
crm_mr_doctor.product = crm_product.id
< /code>

, aber es gibt einen Kommas -Trennwerte in der Spalte, und ich muss unterhalb der Weise ausgegeben werden.Array
(
[0] => stdClass Object
(
[id] => 1
[mr_name] => john
[mr_email] => abc@gmail.com
[mr_mobile] => 9876543210
[doctor] =>([0]=>stdClass Object
(
[id] => 1
[dr_name] => Abhishek
[product] =>([0]=>stdClass Object
(
[id] => 1
[product_name] => crocin
[unit] => 50
[pts] => 50
)
[1]=>stdClass Object
(
[id] => 2
[product_name] => crocin2
[unit] => 60
[pts] => 100
)
)

)
[1]=>stdClass Object
(
[id] => 1
[dr_name] => Krishnan
[product] =>([0]=>stdClass Object
(
[id] => 2
[product_name] => crocin2
[unit] => 60
[pts] => 100
)
[1]=>stdClass Object
(
[id] => 2
[product_name] => crocin4
[unit] => 70
[pts] => 80
)
[2]=>stdClass Object
(
[id] => 2
[product_name] => crocin5
[unit] => 80
[pts] => 50
)
)

)
)
)
)
< /code>

Ich muss Abfrage in Codesigniter schreiben, um wie oben auszugeben. Bitte helfen Sie mir, dieses Ergebnis zu erzielen, danke < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post