I am trying to create a pricing system for a bookings company, I have a DataBase table full of prices. A typical row looks like this:
priceID | manufac | model | janDay | janWeek | febDay | febWeek | etc etc
--------------------------------------------------------------------------------------
1 |Chevrolelt | Matiz | 40.00 | 133.00 | 40.00 | 133.00 | etc etc
Basically I have a variable:
$startmonth
This variable is set by my code finiding out the month, and depending on its number assigning it a value. In this instance lets assume that it has gone through that and obtained the value:
$startmonth = 'febWeek';
I then have another query that finds out the model of a car, I have tested this and it returns the model, so we know that:
$model = 'Matiz';
Then I execute another query to gain the price:
$getprice = mysql_query("SELECT '".$startmonth."' FROM prices WHERE model = '".$model."' ");
while($ppdrow = mysql_fetch_assoc($getprice)) {
$priceperday = $ppdrow;
}
I have tried this query numerous ways and I always end up with errors or an undesirable result. When it should return 133.00.
What it actually returns:
( [2] => 2 )
I am proobably doing something really stupid, but can anyone tell me what please?