Jump to content

SELECT intersect problem


ninedoors

Recommended Posts

Is there anything wrong with this query?

 

I have two tables one named 'currentlocations' and the other named 'frcstqunt'.  They both have a column named sku.  Is this the correct way to select only the sku's from currentlocations that are also in frcstqunt? 

 

<?php
//get matching skus from currentlocations
$query = "SELECT currentlocations.sku FROM currentlocations WHERE currentlocations.sku = frcstqunt.sku";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
$arraycurrsku[] = $row['sku']; 
}
?>

 

I have checked the sku's in each table manually and there are exact matching skus that exist in both but I am return an empty array.  I would like to collect them all in an array for use.  Any thoughts?

Link to comment
https://forums.phpfreaks.com/topic/100316-select-intersect-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.