Hi,
I'm relatively new to php, but I have a site built by a friend who is away, and I need to modify the code.
I have a field in a mySQL db table knit
field Type NULL Default
yarnco_orig enum('YES', 'NO') Yes YES
I have a web page that calls vairous values from this table and prints them to the page (The site uses FastTemplates) using the following:
$query = "select *, knit.description as kd from knit, knit_cat_map, brand_knit_map, yarn_brand, skill, needle_width where needle_width.id = knit.needle_id and skill.type_id = knit.skill_id and yarn_brand.brand_id = brand_knit_map.brand_id and brand_knit_map.knit_id = knit.knit_id and knit.knit_id = knit_cat_map.knit_id and knit_cat_map.knit_id=" . $knitId;
$result = mysql_query ($query, $db) or die(mysql_error());
if ($line = mysql_fetch_array($result)) {
$tpl->assign('KNIT_ID', $line["knit_id"]);
$tpl->assign('NAME', $line["name"]);
etc for the rest of the values in the table
I want to a line that says if yarnco_orig is equal to 'YES' echo "MY html and TEXT"
if yarnco_orig is eqaul to 'NO' leave blank.
I've made a few attempts but there is something wrong with what I'm doing.
Any suggestions?