how to check if id exists in another table sql

SELECT dash_users.id,dash_users.email FROM dash_users LEFT JOIN restaurant ON restaurant.vid = dash_users.id WHERE NOT EXISTS (SELECT 1 FROM dash_users WHERE dash_users.id=restaurant.vid ) ORDER BY restaurant.id DESC limit 0,100

Advertisements

To Remove tags removed wordpress

Friendly speaking while using the TinyMCE editor in wordpress this one is the issue it from go to visual to text its removing those tags

for overcome those issues  do not remove formatting just use this way

Write your <p> tags like this:

<p dir="ltr">something</p>

 

To prevent that, br tags can be written like this:

<br class="blank" />

Assign Related Products Programmatically In Magento 1.9

$product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,$products);
$data = ”;
$relatedData = $product->getRelatedProductIds();
$insertIt = array();
if(count($relatedData) > 0){
foreach($relatedData as $relatedProduct)
{
$insertIt[$relatedProduct] = array(‘position’=>0,’qty’=>”) ;
}
}
$insertIt[$pr_id]= array(‘position’=>0,’qty’=>”);
try{
$product->setRelatedLinkData($insertIt)->save();
Mage::getSingleton(‘adminhtml/session’)->addSuccess(Mage::helper(‘adminhtml’)->__(‘Product assigned succesfully’));
}
catch(Exception $e)
{
Mage::getSingleton(‘adminhtml/session’)->addError(Mage::helper(‘adminhtml’)->__(‘There is problem with products, please refresh the page to see the result’));
}