Categories
Database Development

Only return second result of mysql stored proc

Good morning. This is my first attempt at a stored proc and it works nicely. The only problem is stat it returns 2 reslult sets, the second result set is the one that i need to import into excell, or php. how di i limit this stored proc to only show the secon result set […]

Categories
Database Development

Only return second result of mysql stored proc

Good morning. This is my first attempt at a stored proc and it works nicely. The only problem is stat it returns 2 reslults, the secon result is the one that i need to import into excell, or php. how di i limit this stored proc to only show the secon result or how can […]

Categories
Mastering Development

ACF gallery images urls

I am using Advanced Custom Fields gallery in a custom post type; I have managed to display images (thumbnails) added to the gallery using the following code $images = get_field(‘gallery’); if( $images ): $images = explode(‘,’, $images); $images = array_filter($images); if( count($images)): ?> <ul> <?php foreach( $images as $image ): $alt = get_the_title($image); $url = […]

Categories
Mastering Development

Prython print format

I start with a list tbe_fmt. having trouble formatting the write to file. Trouble in left justify. Perhaps better way. tbe_fmt = [] for i,j,k in zip(idx_tbe, inn_dia, out_dia): tbe_fmt.append(str(inn_dia[i])+’ x ‘+str(out_dia[i])) >>> tbe_fmt = [‘1.63 x 1.91’, ‘2.09 x 2.38’, >>> ‘2.50 x 2.88’, ‘3.10 x 3.50’, >>> ‘4.06 x 4.50’] tbe_str = ” […]

Categories
CMS Joomla Mastering Development

Altering the SQL custom field

If I hardwire an sql custom field, the query works as it should (for this specific userid, 305): SELECT id AS value, title AS text FROM #__content where catid = 8 and created_by = 305 What I want to do is allow the created_by clause to be dynamic : Substituted with JFactory::getUser()->id; I figured if […]

Categories
CMS Mastering Development Wordpress

Select two attributes to display on the Category page of Woocommcere

I am using the code below to display the in-stock sizes of clothing items on the category page. The issue I am trying to resolve is that on the footwear category, they use a different attribute. So ideally I am looking to add an additional attribute to the code below. Maybe something like: $taxonomy = […]

Categories
CMS Mastering Development Wordpress

Custom WP_Query not acknowledging search category & tag at the same time, but work independently

I have elaborate search functionality on one of my sites, it is using a custom WP_Query that will allow for an ‘AND’ & ‘OR’ relation between the users selections. It will then generate the result and overwrite the existing products in the product list. This is all being done using AJAX and a function within […]

Categories
Mastering Development

Stored procedure to check data type of every value

I want to create a stored procedure that copy data from table A to table B. The structures of table looks like: create table_A( Name nvarchar (max) NULL, Id nvarchar (max) NULL, dob nvarchar (max) NULL, duration nvarchar (max) NULL ) create table_B( Name nvarchar (2000) NULL, Id nvarchar (max) NULL, dob datetime NULL, duration […]

Categories
CMS Magento Mastering Development

How to implement form submission validation on the backend

I have a form validation using data-mage-init='{“validation”: {}}’ but if I disable js in the browser the form will be submitted without validation, tell me how to fix this problem on the backend side? I have a controller for submitting a form public function execute() { /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $data […]

Categories
CMS Mastering Development Wordpress

I can ‘t display product images based on the label

The task is as follows. We have a product card template in Elementor, we have products with tags. The task is to use the Portfolio tool to display images of products that belong to the same label as the product that we visited. I understand this can be done by creating a certain filter and […]