They have their own databases.
We need to check via the UK site, if a product is held on each of the other sites.
There is a primary code used, (tho it varies with two characters at the start).
I need to open the UK conn, query for each code, and test that code against each other site. If found, update the UK site.
It would have been something like this:
Code: Select all
include "dbconn.php";
$result = mysql_query ("SELECT romancode FROM products");
while ($row = mysql_fetch_object($result))
{
$rcid = $row->rcode;
`include "second_dbconn.php";
$result2 = mysql_query ("SELECT romancode FROM products WHERE romancode = '$rcid'");
$num_result = mysql_num_rows($result2);
if ($num_result != 0)
{
mysql_query(UPDATE products (from the dbconn.php connection) SET site2 = "in" WHERE romancode = "$rcid");
}
mysql_close($sqlconn);
`include "third_dbconn.php";
$result2 = mysql_query ("SELECT romancode FROM products WHERE romancode = '$rcid'");
$num_result = mysql_num_rows($result2);
if ($num_result != 0)
{
mysql_query(UPDATE products (from the dbconn.php connection) SET site2 = "in" WHERE romancode = "$rcid");
}
mysql_close($sqlconn);
}Basically - just need to test each 'code' against multiple sites. If the code is in, then update the local site.
I suppose another way, might be to store variables in sessions, and on-the-fly add more sessions with a count ($session1, 2, 3, 4) and then queries those against the databases.