# \[Solved\] migxLoopCollection no prefix table name error

**URL:** <https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051>\
**Category:** Random\
**Tags:** migxdb\
**Created:** [September 30, 2024, 10:28am UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051 "2024-09-30T10:28:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ysanmiguel](https://community.modx.com/user_avatar/community.modx.com/ysanmiguel/32/285_2.png) [@ysanmiguel](https://community.modx.com/u/ysanmiguel)\
**Post date:** [September 30, 2024, 10:28am UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051/1 "2024-09-30T10:28:21Z")

</div>

Hello, On ModX 2.8.7 I’m trying to use migxLoopCollection with PHP Version 8.2.23

```auto
[[!migxLoopCollection?
    &packageName=`NAME`
    &classname=`CLASS`
    &limit=`10`
    &debug=`1`
    &tpl=`@CODE:[[+FirstName]]`
]]

```

but I’m getting this error:

```auto
Deprecated : Creation of dynamic property modX::$migx is deprecated in /var/www/vhosts/NAME/public_html/core/xpdo/xpdo.class.php on line 1238
SELECT `Enquiry`.`id`, `Enquiry`.`digestSent`............. `Enquiry`.`StopOver` FROM `enquiries` AS `Enquiry` LIMIT 10

```

Any ideas please?

Thanks!

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [September 30, 2024, 12:05pm UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051/2 "2024-09-30T12:05:13Z")

</div>

> [@ysanmiguel](#):
>
> but I’m getting this error:

This is not an error. It’s a deprecation warning and the MIGX code should still work correctly.

* * *

When `$modx->getService()` is called, MODX creates a dynamic property.  
This will (most likely) be fixed in the next version:

> <https://github.com/modxcms/xpdo/pull/257>
>
> This avoids the deprecation warning when dynamic properties are assigned to the …class in 8.2+ and resolves #256

---

<div class="post-metadata">

**Author:** ![ysanmiguel](https://community.modx.com/user_avatar/community.modx.com/ysanmiguel/32/285_2.png) [@ysanmiguel](https://community.modx.com/u/ysanmiguel)\
**Post date:** [September 30, 2024, 12:06pm UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051/3 "2024-09-30T12:06:50Z")

</div>

Excellent, thanks mate.

---

<div class="post-metadata">

**Author:** ![ysanmiguel](https://community.modx.com/user_avatar/community.modx.com/ysanmiguel/32/285_2.png) [@ysanmiguel](https://community.modx.com/u/ysanmiguel)\
**Post date:** [September 30, 2024, 12:41pm UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051/4 "2024-09-30T12:41:31Z")

</div>

OK I changed the error\_reporting to 14327  
`error_reporting', 14327`

so the deprecated message is gone, I thought it was creating some problem with the query in any way, sorry my mistake.

but I’m still having a problem, the call is not displaying anything:

The table was created long time ago for somebody else without the prefix: `modx_` but the package is there with all the info it needs: model, schema, etc.

So using this call:

```auto

[[!migxLoopCollection?
    &packageName=`NAME`
    &classname=`CLASS`
    &prefix=``
    &limit=`10`
    &debug=`1`
    &tpl=`@CODE:[[+placeholder]]`
]]

```

I can see in the query with all the table fields but the table name is:  
**FROM `modx_tablename`**

even when I tried to remove the prefix:  
**&prefix=``**

That is causing the problem.  
How can I remove the prefix in that case?

Thanks for your help @halftrainedharry as always mate!

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [September 30, 2024, 1:26pm UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051/5 "2024-09-30T13:26:01Z")

</div>

> [@ysanmiguel](#):
>
> How can I remove the prefix in that case?

Try using the property `&useCustomPrefix` as well:

```auto
[[migxLoopCollection?
    &prefix=``
    &useCustomPrefix=`1`
    ...
]]

```

---

<div class="post-metadata">

**Author:** ![ysanmiguel](https://community.modx.com/user_avatar/community.modx.com/ysanmiguel/32/285_2.png) [@ysanmiguel](https://community.modx.com/u/ysanmiguel)\
**Post date:** [September 30, 2024, 8:07pm UTC](https://community.modx.com/t/solved-migxloopcollection-no-prefix-table-name-error/8051/6 "2024-09-30T20:07:07Z")

</div>

> [@halftrainedharry](#):
>
> `&useCustomPrefix=`1``

Fantastic, thanks for your help mate.  
Amazing!
