Forum Moderators: coopster
1. construct your query
2. use mysql_query to get your results from the db
3. use a loop to append each value to a variable
for int coltype
$var1 = "";
while($row = mysql_fetch_array($result)) {
$var1 .= $row['mycol'] . ',';
}
for varchar coltype
$var1 = "";
while($row = mysql_fetch_array($result)) {
$var1 .= "'" . $row['mycol'] . "',";
}
4. chop the trailing comma
$var1 = substr($var1,0,strlen($var1)-1);
5. use this var to create your new query