nodespace Posted November 21, 2021 Share Posted November 21, 2021 Hello, To preface this, I'm not a developer, but I've been trying to update some old code I have to work on my modern WHMCS installation. I'm trying to use this in a hook: $result = Capsule::table('tbltickets') ->join('tblticketreplies', 'tbltickets.id', '=', 'tblticketreplies.tid') ->select('tbltickets.date', 'tblticketreplies.date', 'tbltickets.id') ->where('tbltickets.id', '=', 'tblticketreplies.tid', 'and', 'tbltickets.admin', '=', '') ->groupBy('tbltickets.id') ->orderBy('tbltickets.date', 'DESC') ->limit(10) ->get(); If I echo out $result, I don't get anything (or I'm doing it wrong - big possibility!). This code, which I use external to WHMCS, works flawlessly to grab the data I need: $result = mysqli_query($connection, "SELECT tk.date, rp.date, tk.id FROM tbltickets as tk, tblticketreplies as rp WHERE tk.id=rp.tid AND tk.admin='' GROUP BY tk.id ORDER BY tk.date DESC LIMIT 0,10"); Any idea what I am doing wrong? I'd use the code that I'm using externally, but since I'm already inside WHMCS, it makes sense to just natively call the database. Also, just for my sanity, I tried using the deprecated full_query function but same result - unable to get the data I need. Thanks! 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.