mail data from from db

`

<?pho mysql_select_db ("interswitch"); $transID = $txRef; $sql = mysql_query("select * from registration where trnxid like '%$transID%' or RegFullName like '%$transID%' "); while ($row = mysql_fetch_array($sql)){ $Snumber = ($row['FormID']); $Fullname = ($row['RegFullName']); $Organization = ($row['RegOrganization']); $Position = ($row['RegPosition']); $Address = ($row['RegAddress']); $Email = ($row['RegEmailaddress']); $Picture = ($row['RegPic']); $Officetell = ($row['RegOfficeTel']); $Mobiletell = ($row['RegMobileTel']); $Fax = ($row['RegFaxTel']); $Pol1 = ($row['RegPol1']); $Pol2 = ($row['RegPol2']); $Orgprofile = ($row['RegOrgProfile']); $RegAtrans = ($row['RegTranYes']); $RegHtrans = ($row['RegHotelYes']); $Date = ($row['Date']); $Amount = ($row['amount']); $Rsp_code = ($row['response_code']); $Rsp = ($row['response']); $Transid = ($row['trnxid']); } echo $email; echo $Fullname; $to = $email; $subject = "Not successfull"; $message = " HTML email

This email contains HTML Tags!

Firstname Lastname
John Doe
"; ?>

`

cant get this to work, its not call data from Database, please help. the echo is not working

ehmmmm there’s no way we can guess what u want to do? first what errors are happening, if not any is error_reporting(E_ALL) on, if it is, try throwing a var_dump on the result u to see if its actually pulling from the db.

what i want to do is pick a email address from the registration table where trnxid is transid. and mail. i forgot to paste in the mail function.

use mysql_fetch_assoc instead