Hello everyone. I'm still new to PHP. What I would like to do is to place the value of the $truck inside the column Truck. I don't have any error messages whenever I run this page, so I don't really know what's wrong, and no values are placed inside the Truck table. The 'Location' belongs to the customer_information table, the rest from the customer_order table.
<?php
include ("database_connection.php");
connect();
$i = 0;
$result1 = mysql_query("SELECT * FROM `customer_information` INNER JOIN `customer_order`");
$count = mysql_num_rows($result1);
if ($count != 0)
while($row1 = mysql_fetch_array($result1)){
$i++;
$order_no = $row1['Order_Number'];
$cust_no = $row1['Customer_Number'];
$receipt_no = $row1['Receipt_Number'];
$date_ordered = $row1['Date_Ordered'];
$exp_date = $row1['Expected_Date'];
$location = $row1['Location'];
$truck = $row1['Truck'];
if ($location == 'place1' || 'place2')
{
$truck = "truck1";
} else if ($location == 'place3' || 'place4' || 'place5' )
{
$truck = "truck2";
} else if ($location == 'place6' || 'place7' || 'place8')
{
$truck = "truck3";
} else if ($location == 'place9')
{
$truck = "truck4";
}
mysql_query("INSERT INTO `customer_order`(Truck) VALUES ('$truck')");
}?>