Get SQL query of vendor with all his real values

Hi i want to connect get the correct “select * from” from the wordpress database for achiaving an external integration.

could you help me recreating the sql query with joins to get all the data of the database?

i do the homework but i couldn’t get the real value only get meta-key as you can see in the photo.

I used this code:

SELECT post_id, meta_key, meta_value FROM Tcpmu_postmeta WHERE post_id IN (1049) ORDER BY meta_id ASC

thanks in advance.

Sorry, there’s no simple code snippet for this, it would require a custom implementation. But as another solution, you can try to use HivePress function to get information from the database. For example, if you want to get the vendor from the database by vendor id, then please try this PHP code snippet

\HivePress\Models\Vendor::query()->get_by_id(vendor_id_here);

hi thanks for your response. It help me but when i want to test your code inside function.php it wasn´t showing nothing.

Can you elaborate a few more your snippet code.
Something very easy for example how to show raw data in some webpage to test the results :pray:

i only one to see raw results please
Thanks in advance

Please try to assign \HivePress\Models\Vendor::query()->get_by_id(vendor_id_here); to some variable and then get information from this object in this way

$variable_name->get_field_name();

Please just change field_name on the field name, which you can find here hivepress/class-vendor.php at 20bab199aeb75cf47979764af2d9576c4ea9230b · hivepress/hivepress · GitHub

Please note that it can require further customization. If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

Also, please do not make direct changes in core files like function.php, as it will be lost on updates. Please try to use the Code Snippets plugin or the child theme instead

thanks for your help

i used this code and it works!

$variable232= \HivePress\Models\Vendor::query()->get_by_id(1049)->get_id;
echo $variable232;

show my id,

but i tried this others code without success,

$variable232= \HivePress\Models\Vendor::query()->get_by_id(1049)->get_description;
echo $variable232;

show null

$variable232= \HivePress\Models\Vendor::query()->get_by_id(1049)->get_field_name(description);
echo $variable232;

show null

$variable232= \HivePress\Models\Vendor::query()->get_by_id(1049)->get_field_description();
echo $variable232;

show null also

$variable232= \HivePress\Models\Vendor::query()->get_by_id(1049)->get_description();
echo $variable232;

show null also

i am doing someting wrong? thanks in advance.

Please try to get a description in this way

$variable232->get_description();

Also, it is possible to find useful developing information about HivePress here Getting started - Developer Docs

Please note that it can require further customization. If you are not familiar with the code customization, then please consider hiring someone for custom work https://fvrr.co/32e7LvY

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.