Stacks Image 335

Connect($db_host, $db_user, $db_pwd, $db_user); # connect to MySQL, agora db $sql = "select supplier_name from fcd_suppliers where supplier_id=".$id; $rs = $conn->Execute($sql); if ($rs === false) die("failed"); while (!$rs->EOF) { print $rs->fields['supplier_name']; $rs->MoveNext(); } ?>

Connect($db_host, $db_user, $db_pwd, $db_user); $sql = 'SELECT supplier_pdf_filename,supplier_pdf_mimetype,supplier_pdf_hash FROM fcd_suppliers where supplier_id='.$id; $news = ''; $rs = $conn->Execute($sql); if ($rs === false) die("failed:".$sql); while (!$rs->EOF) { if (strlen($rs->fields['supplier_pdf_hash']) > 0) { $filename = '../resources/files/' . $rs->fields['supplier_pdf_hash'] . '.' . trim(system_mime_type_extension($rs->fields['supplier_pdf_mimetype'])); /*first check if file already exists.*/ if (file_exists($filename)) { /*do nothing*/ } else { $conn1 =& ADONewConnection('mysql'); $conn1->Connect($db_host, $db_user, $db_pwd, $db_user); $sql1 = 'select supplier_pdf,supplier_pdf_filename,supplier_pdf_mimetype,supplier_pdf_hash FROM fcd_suppliers where supplier_id='.$id; $rs1 = $conn1->Execute($sql1); if ($rs1 === false) die("failed:".$sql1); while (!$rs1->EOF) { $data1 = $rs1->fields['supplier_pdf']; $fh = fopen($filename, 'w'); fwrite($fh, $data1); fclose($fh); $rs1->MoveNext(); } } $news = $news . ''; } $rs->MoveNext(); } echo $news; ?>
Connect($db_host, $db_user, $db_pwd, $db_user); # connect to MySQL, agora db $sql = "select supplier_desc_txt from fcd_suppliers where supplier_id=".$id; $rs = $conn->Execute($sql); if ($rs === false) die("failed"); while (!$rs->EOF) { print $rs->fields['supplier_desc_txt']; $rs->MoveNext(); } ?>