What am i doing wrong, It works when I hard code it, but when I try get the names from MySql it gives me the finger, cannot access docs OR it sends the mail wth no attachemnts is there a better way or something that I am missing,
Look my code and the things I tried:
$attachment_query = "SELECT document FROM transact WHERE clientid=$clientid AND document IS NOT NULL";
$result = mysql_query($attachment_query ) or die (mysql_error());
while ($records = mysql_fetch_array($result)) {
//DATA
$document = $records['document'];
$directory = "docs/";
$myfile = $directory.$document;
//$mail->AddAttachment("docs/1002920123010124348.pdf", "1002920123010124348.pdf");
//$mail->AddAttachment($directory.$document, $document);
//$mail->AddAttachment("docs/".$document, $document);
//$mail->AddAttachment('docs/'.'$document', '$document');
$mail->AddStringAttachment($document, $document);
}
$mail->Send();
What do I use for doing this: $mail->AddAttachment(MYSQLDATA, MYSQLDATA);