hi
i reckon i'm going about this all wrong
i'm trying to pull out a list of names from a table of our partners
and then insert this list into another sql statement.
The aim - so i don't have to rewrite the sql statement when we add other partners
-
i'm getting errors when i try to assign values using mysql_fetch_array
have a look at the code, if you would be so kind
you'll see a hacked attemped at trying to avoid these errors by trial and error in the first half -
and i get an error
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in c...
for the line
$ftr_id = $row[\"ftr_id\"];
i guess it really doesnt like the escaped characters
//
$kpl_sql = "Select kpl_name from kpl_members";
$kpl_sql_result= mysql_query($sql,$connection) or die ("couldn't execute kpl query");
while ($row = mysql_fetch_array($sql_result))
{
$kpl_name = $row["kpl_name"];
$kpl_list .= "kpl_name,";
$kpl_assign .= "$ftr_box";
$kpl_assign .= $kpl_name;
$kpl_assign .= "= $row";
$kpl_assign .= "[\"ftr_box";
$kpl_assign .= $kpl_name;
$kpl_assign .= "\"];\n";
}
//connect to ftr database to pull out the description and if it is
//assigned to any kipple members
//first get the assigment grammar straight
$assign = "
while ($row = mysql_fetch_array($sql_result)) {
$ftr_id = $row[\"ftr_id\"];
$ftr_name = $row[\"ftr_name\"];
$ftr_shortdescription = $row[\"ftr_shortdescription\"];
" ;
$assign .= " $kpl_assign;
$sql ="Select ftr_id,
ftr_name,
$kpl_list,
ftr_shortdescription
from btv_features
where ftr_id=$ftr_id";
$sql_result= mysql_query($sql,$connection) or die ("couldn't execute feature query");