[Skip to main content](#vessel-content)

#   PHP experts - Custom Field and Listing Orders

##

- **[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")**
- [![unlockalicante's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar30721.jpg)](/forum/user/30721-unlockalicante "View unlockalicante's Profile") Topic Author
- [ Offline](/forum/user/30721-unlockalicante)

Less More

- Posts: 8
- Thank you received: 0
-
-
- [](http://www.apli.movil-plus.com)
-

12 years 9 months ago -  12 years 9 months ago [\#139990](#139990) by [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")  *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#139990 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")* was created by *[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")*

-- url of the page with the problem -- : [ www.apli.movil-plus.com](http://www.apli.movil-plus.com)
-- HikaShop version -- : 2.0.0
-- Joomla version -- : 3.1.5

Good afternoon ,

Request help to display a custom field ( table "item" ) in the list of orders ( listing.php ) .

My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .

By using the following code:

&lt;?php
$conexion=mysql_connect("localhost","XXXXX","")
or die("Problemas en la conexion");

mysql_select_db("base1",$conexion)
or die("Problemas en la selección de la base de datos");

$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product",$conexion) or
die("Problemas en el select:".mysql_error());

while ($reg=mysql_fetch_array($registros))
{

echo $reg."&lt;br&gt;";
}

mysql_close($conexion)."&lt;br&gt;";
?&gt;

The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .

I hope someone help me with this problem took a long time and can not find solution.

Greetings and thanks in advance.

- [ ![h850d5e8.png](/forum/attachment/14726) ](/forum/attachment/14726 "h850d5e8.png") [ ](/forum/attachment/14726?download=1 "h850d5e8.png")

Last edit: 12 years 9 months ago by [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

12 years 9 months ago [\#140022](#140022) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#140022 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")*

The line:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product",$conexion) or
die("Problemas en el select:".mysql_error());
is not correct.
You would need instead something like that:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id="(int).$row-&gt;order_id,$conexion) or
die("Problemas en el select:".mysql_error());

The following user(s) said Thank You: [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")**
- [![unlockalicante's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar30721.jpg)](/forum/user/30721-unlockalicante "View unlockalicante's Profile") Topic Author
- [ Offline](/forum/user/30721-unlockalicante)

Less More

- Posts: 8
- Thank you received: 0
-
-
- [](http://www.apli.movil-plus.com)
-

12 years 9 months ago [\#140027](#140027) by [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")  Replied by *[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")* on topic *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#140027 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")*

Hi, thanks for the reply,

I changed the line you and not charge you indicate page is completely blank.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

12 years 9 months ago [\#140055](#140055) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#140055 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")*

Turn on the debug mode and error reporting options of the joomla configuration and try again. You should see an error message telling you what's wrong.

The following user(s) said Thank You: [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")**
- [![unlockalicante's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar30721.jpg)](/forum/user/30721-unlockalicante "View unlockalicante's Profile") Topic Author
- [ Offline](/forum/user/30721-unlockalicante)

Less More

- Posts: 8
- Thank you received: 0
-
-
- [](http://www.apli.movil-plus.com)
-

12 years 9 months ago [\#140071](#140071) by [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")  Replied by *[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")* on topic *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#140071 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")*

Hi Nicolas,

This is the error:

Parse error: syntax error, unexpected T_INT_CAST in /hosting/www/movil-plus.com/apli/templates/rt_paradigm/html/com_hikashop/order/listing.php on line 143

And the line number 143:

$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id="(int).$row-&gt;order_id,$conexion) or die("Problemas en el select:".mysql_error());

Thx

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 9 months ago -  12 years 9 months ago [\#140076](#140076) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#140076 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")*

Hi,

Using the code tag is better for code display.
At this moment you will see that there was a point between the (int) and the $row-&gt;order_id.

Code fixed: Code:

$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id=".(int)$row-&gt;order_id,$conexion) or die("Problemas en el select:".mysql_error());

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 12 years 9 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

The following user(s) said Thank You: [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")**
- [![unlockalicante's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar30721.jpg)](/forum/user/30721-unlockalicante "View unlockalicante's Profile") Topic Author
- [ Offline](/forum/user/30721-unlockalicante)

Less More

- Posts: 8
- Thank you received: 0
-
-
- [](http://www.apli.movil-plus.com)
-

12 years 9 months ago [\#140078](#140078) by [unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")  Replied by *[unlockalicante](/forum/user/30721-unlockalicante "View unlockalicante's Profile")* on topic *[PHP experts - Custom Field and Listing Orders](/forum/31-development/865054-php-experts-custom-field-and-listing-orders#140078 "-- url of the page with the problem -- :   www.apli.movil-plus.com  -- HikaShop version -- : 2.0.0 -- Joomla version -- : 3.1.5  Good afternoon ,  Request help to display a custom field ( table &quot;item&quot; ) in the list of orders ( listing.php ) .  My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .  By using the following code:  ?php $conexion=mysql&#95;connect(&quot;localhost&quot;,&quot;XXXXX&quot;,&quot;&quot;) or die(&quot;Problemas en la conexion&quot;);  mysql&#95;select&#95;db(&quot;base1&quot;,$conexion) or die(&quot;Problemas en la selección de la base de datos&quot;);  $registros=mysql&#95;query(&quot;SELECT imei2 FROM jos&#95;hikashop&#95;order&#95;product&quot;,$conexion) or die(&quot;Problemas en el select:&quot;.mysql&#95;error());  while ($reg=mysql&#95;fetch&#95;array($registros)) {  echo $reg.&quot;&quot;; }  mysql&#95;close($conexion).&quot;&quot;; ?&gt;  The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .  I hope someone help me with this problem took a long time and can not find solution.  Greetings and thanks in advance.")*

Perfect!!

Thank you!, This part was essential for my project.

Really, thanks for your attention and speed in the solution.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2NTA1NC1waHAtZXhwZXJ0cy1jdXN0b20tZmllbGQtYW5kLWxpc3Rpbmctb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.120 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
