Thanks for the reply.
Still not quite working. I've made some revision in the hope that it explains my situation a little better.
Here is the code:
<?
foreach ($_SESSION['cart'] as $isbn => $qty)
{
$connection=mysql_connect("localhost","user","pass") or die('Could not connect to the database server');
$db = mysql_select_db("db", $connection) or die ("Unable to select database.");
$sql = "select * from movie where movie_id='$isbn' group by movie_title order by movie_title asc";
$sql_result = mysql_query($sql,$connection) or die ("Could not select data");
while ($row = mysql_fetch_array($sql_result)){
$movie_stock = $row['movie_stock'];
$movie_ship_charge = $row['movie_ship_charge'];
if($movie_stock == 'yes' && $movie_ship_charge == 'yes')
{
$result = "true1";
} else if ($movie_stock == 'no' && $movie_ship_charge == 'no')
{
$result = "true2";
} else if ($movie_stock == 'no' && $movie_ship_charge == 'yes')
{
$result = "true3";
}
echo "$result<br>";
}
}
if($result == "true1" && $result == "true2" && $result == "true3"){
?>
<TABLE width=290 border=0 cellPadding=0 cellSpacing=5 bgcolor="#7B88A9">
<TBODY>
<TR>
<TD colSpan=2>How would you like your order
shipped?<br>
<br>
When the</TD>
<TD width=10></TD>
</TR>
<TR>
<TD colSpan=3 height=10> </TD>
</TR>
<TR vAlign=top>
<TD class=text2 width=17><INPUT type=radio CHECKED value="1" name="ship_arg"></TD>
<TD class=text2 width=251>1. Pre-Order arrives
or </TD>
<TD width=10> </TD>
</TR>
<TR>
<TD colSpan=3 height=10> </TD>
</TR>
<TR vAlign=top>
<TD class=text2 width=17><INPUT type=radio value="2" name="ship_arg"></TD>
<TD class=text2 width=251>2. When the Out of
Stock Arrives or</TD>
<TD width=10> </TD>
</TR>
<TR>
<TD colSpan=3 height=10> </TD>
</TR>
<TR vAlign=top>
<TD class=text2 width=17><INPUT type=radio value="3" name="ship_arg"></TD>
<TD class=text2 width=251>3. ship as they come
in.</TD>
<TD width=10> </TD>
</TR>
<TR>
<TD colSpan=3 height=10> </TD>
</TR>
</TBODY>
</TABLE>
<?
}
?>
Now, lets say that the first result produced
$movie_stock == 'no' && $movie_ship_charge == 'no'
which = true2 and the second result produced
$movie_stock == 'yes' && $movie_ship_charge == 'yes'
which = true1 and the third result produced
$movie_stock == 'no' && $movie_ship_charge == 'yes'
which = true3.
How can i get the final if statement eg.
if($result == "true1" && $result == "true2" && $result == "true3")
{
to execute if the results equal true1 and true2 and true3?
Even if there were 4,5,6 or whatever results, if any of the values are equal to true1 and true2 and true3 then i want the final if statement to execute.
Any help most appreciated.
Cheers,
micmac