Search
 
SCRIPT & CODE EXAMPLE
 

PHP

join with 2 table where id match in table 1 comma separated

<?php 
 SELECT `mgt_products`.`id`,`mgt_products`.`pro_name`,`mgt_products`.`cate_id`,
	`mgt_products`.`subcate_ids`,`mgt_subcategories`.subcat_id FROM `mgt_products` 
	JOIN `mgt_categories` ON `mgt_products`.`cate_id` = `mgt_categories`.`cat_id`
	JOIN `mgt_subcategories` ON find_in_set(mgt_subcategories.subcat_id, mgt_products.`subcate_ids`)
    WHERE `mgt_categories`.`cat_id` = 2
    AND find_in_set(7, mgt_products.`subcate_ids`)
    GROUP BY `mgt_products`.`id`
      
?>      
Comment

PREVIOUS NEXT
Code Example
Php :: laravel collection tap 
Php :: how to register a file in a config in laravel 
Php :: php get sql update from session 
Php :: verify laravel string must be null 
Php :: laravel postgres deadlock 
Php :: Protect Your Site from Malicious Requests 
Php :: check if product has crosssell woocommerce 
Php :: wp query compare like and or 
Php :: mysqli_query() expects parameter 1 to be mysqli 
Php :: how to fetch data from two tables in mysqli using php 
Php :: dir instalación ZendStudiopluginscom.zend.php.debug.debugger.win32.x86_10.6.0.v20140121-1240 esourcesphp.ini 
Php :: wordpress add_action echo on edit page 
Php :: get cpanel username php 
Php :: php jwt firebase 
Php :: $n = readline(); for($i = 0; $i < $n ; $i++) { $name = readline(); $names[$name] = (isset($names[$name]) ? $names[$name] + 1 : 1); } 
Php :: wc php coupon applied message still after coupon delete 
Php :: laravel collection makeVisible 
Php :: cache.backend.null 
Php :: add attribute to model laravel 
Php :: remove database in codeigniter 
Php :: CakeResque::enqueue 
Php :: php docblock 
Php :: php upload image to another subdomain 
Php :: laravel 8 api validation 
Php :: htaccess file for multisite 
Php :: pass yield to vue component laravel 
Php :: php encrypt decrypt online 
Php :: wordpress add menu frontend 
Php :: php imap before date subject 
Php :: laravel , How can I increment and decrement value with unique id 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =