sorry due to work comments I have not been able to get back to this but lets get it on.
I have 2 tables which are tbl_temp_products and tbl_temp_categories and the fields as below (there are more fields but not relevant to this question)
tbl_temp_products contains colums called id and categories
eg.
id - row value 1
categories - row values - 100175, 100575 (this is how they are stored in this table)
tbl_temp_categories
eg.
categories_id - row value 100175
categories_name - row value Mugs
categories_id - row value 100575
categories_name - row value Souvenirs & Seaside
I presume I need to join the tables with a query to be able to update the price by percentage by category in tbl_temp_products
I have the following code which creates a dropdown with the categories from tbl_temp_categories
[code] <?php
$sql = “SELECT categories_id, categories_name FROM tbl_temp_categories”;
$result = $conn->query($sql);
echo "<select name='categories_name' class='form-control'>";
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['categories_name'] . "'>" . $row['categories_name'] . "</option>";
}
echo "</select>";
?>
[/code]
Do I use a cross, inner, outer, left or right join as I am a bit confused on how to link the 2 tables.
I hope all the above made sense urgh