dk4210
01-20-2012, 02:37 PM
Hello Guys,
I have a question
I have the following query
$result3 = mysql_query("SELECT * FROM table1 WHERE ad_id='$id2'")
or die(mysql_error());
$row3 = mysql_fetch_array( $result3 );
// Grab all the var
$features = $row3['features'];
I am turning it into an array (comma separated)
$feature2 = explode(",", $features);
print_r($feature2);
)
The result is like so
Array ( [0] => 5 [1] => 9 [2] => 13
I want to query the features for just the ids (F_name) are for the features . This query will show all.. I would like to just display the f_name values from the array query.
// build and execute the query
$sql = "SELECT * FROM features";
$result = mysql_query($sql);
// iterate through the results
while ($row = mysql_fetch_array($result))
{
echo $row['f_name'];
echo "<br />";
}
Please Advise..
Thanks, Dan
I have a question
I have the following query
$result3 = mysql_query("SELECT * FROM table1 WHERE ad_id='$id2'")
or die(mysql_error());
$row3 = mysql_fetch_array( $result3 );
// Grab all the var
$features = $row3['features'];
I am turning it into an array (comma separated)
$feature2 = explode(",", $features);
print_r($feature2);
)
The result is like so
Array ( [0] => 5 [1] => 9 [2] => 13
I want to query the features for just the ids (F_name) are for the features . This query will show all.. I would like to just display the f_name values from the array query.
// build and execute the query
$sql = "SELECT * FROM features";
$result = mysql_query($sql);
// iterate through the results
while ($row = mysql_fetch_array($result))
{
echo $row['f_name'];
echo "<br />";
}
Please Advise..
Thanks, Dan