tommy2shoes Posted April 29, 2011 Share Posted April 29, 2011 I have produced pdfs before using TCPDF but they have all used results from 1 table. Now I want to get data from two tables - applicant and finance which are linked by the applicantid field. Part of the code is: mysql_select_db($database_process, $process); $result = mysql_query("SELECT applicantid, idcode, type, company, email, concat_ws('<br/>',case when coalesce(add1,'')>''then add1 end,case when coalesce(add2,'')>''then add2 end, case when coalesce(town,'')>''then town end,case when coalesce(postcode,'')>'' then postcode end) as address, DATE_FORMAT(applicationdate,'%D %M %Y') AS fDate, CONCAT(forename,' ',surname) AS name FROM applicant INNER JOIN finance ON finance.applicantid=applicant.applicantid WHERE idcode = '$appidpassed' LIMIT 1 "); while($row = mysql_fetch_array($result)) { $appid = $row['applicantid']; $idcode = $row['idcode']; $type = $row['type']; $company = $row['company']; $email = $row['email']; $address = $row['address']; $printdate = $row['fDate']; $apname = $row['name']; } But when I run this I get an error something like: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in --- .php on line 68 Line 68 is the line while($row = mysql_fetch_array($result)) What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/235068-tcpdf-and-joining-tables/ Share on other sites More sharing options...
fenway Posted May 1, 2011 Share Posted May 1, 2011 TCPDF ???? Quote Link to comment https://forums.phpfreaks.com/topic/235068-tcpdf-and-joining-tables/#findComment-1209135 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.