hello all
Ive got a problem with a query which is probably fairly simple, i'd be most grateful if someone could help me out.
i want to select items from a table where they are equal to a certain id, which is from an array.
eg
select distinct * from table where id = '$array';
at present it only pulls out one record from the array 🙁 what am i missing here?
heres the code
<?
include("os_conn.inc");
require("fns.php");
$date=date("Y-m-d");
if(!$cust){
$q="select distinct * from customers order by c_id ";
$rst=mysql_query($q);
}
if($cust){
$q="select distinct * from customers where c_id = '$cust' order by c_id ";
$rst=mysql_query($q);
}
@ $num_results = mysql_num_rows($rst);
echo"$num_results customers in the database";
// for ($i=0; $i <$num_results; $i++) {
echo"<form action=\"addresses_cid.php\" method =\"get\">";
while($barow=mysql_fetch_array($rst)){
$barow['c_address1']= ucwords ($barow['c_address1']);
$barow['c_address2']= ucwords ($barow['c_address2']);
$barow['c_pcode']= strtoupper ($barow['c_pcode']);
echo"<table width=\"50%\" border=\"0\">
<tr>
<td valign=top>
<P> <b>$barow[c_name]</b><br>
$barow[c_address1]<br>
$barow[c_address2]<br>
$barow[c_pcode]<br>
Tel:$barow[c_phone]<br>
Fax:$barow[c_fax]</p>
</td>
<td valign=top align=right><p><b>Company ID:</b> $barow[c_id] <br>
<br><b>Date: </b> $date</p> <input type=\"checkbox\" name=\"cust\" value=\"$barow[c_id]\"></td></tr></table><br><br>";
}
echo"<input type=submit value=submit>
</form>";
?>
tia
rob