computers.wheneva Posted April 22, 2011 Share Posted April 22, 2011 Hi Guys & Gals, Need some help with the PDF Invoice, I am not an SQL Fundi , but would like to achieve to get the only domain name onto the invoice, I have tried almost all day today. Possible can someone please point me in the right direction. SQL Statement $serv = "localhost"; $user = "username"; $pass = "password"; $db = "mydb"; $con = mysql_connect($serv,$user,$pass); if (!$con){die('Could not connect: ' . mysql_error());} mysql_select_db($db, $con); $result = mysql_query( "SELECT tblinvoices.id, tbldomains.userid, tbldomains.domain, tblorders.ordernum FROM tblorders LEFT JOIN tbldomains ON tbldomains.orderid = ".tblorders.id."LEFT JOIN tblinvoices ON tbldomains.userid = ".tblinvoices.userid." WHERE tblinvoices.userid = ".$userid." AND tblinvoices.id = ".$invoicenum.") while($row = mysql_fetch_array($result)) { $row['ordernum'];} mysql_close($con); All help is welcome Thanks Computers Wheneva http://www.wheneva.co.za 0 Quote Link to comment Share on other sites More sharing options...
computers.wheneva Posted April 23, 2011 Author Share Posted April 23, 2011 Sorted it out, you need to join tblorders on tblinvoices and tblinvoiceitems. Computers Wheneva http://www.wheneva.co.za 0 Quote Link to comment 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.