amol.karande Posted February 6, 2008 Share Posted February 6, 2008 $sql = 'SELECT `userid` FROM `tblorders` WHERE `id` = $vars["OrderID"] LIMIT 0, 30 '; $sql = 'SELECT * FROM `tblclients` WHERE `id` = `$userid` LIMIT 0, 30 '; I am trying to run these two queries in actionhooks.php but I am not able to run those.But same queries with hardcodes values for $ordervar`,`$userid` respectively runs perfectly .Also I have tested those variable with various combination of coates but not getting please give the the solution over it thank you 0 Quote Link to comment Share on other sites More sharing options...
RPS Posted February 6, 2008 Share Posted February 6, 2008 Change "OrderID" to "OrderNumber" If that doesn't work...: What function within actionhooks are you using? Here's the code I use to look up the reference id and client id based on invoice: $invoiceID = $vars['InvoiceID']; // lookup relid & userid from the invoiceid, we will use the clientid later to send out an email $result = mysql_query("SELECT relid,userid FROM tblinvoiceitems WHERE type='Hosting' AND invoiceid='".$invoiceID."'"); $grab_relid = mysql_fetch_row($result); $relid = $grab_relid[0]; $clientid = $grab_relid[1]; Also, why specify a limit in the SQL if you should only ever return 1 client via userid? 0 Quote Link to comment Share on other sites More sharing options...
amol.karande Posted February 7, 2008 Author Share Posted February 7, 2008 Thank you sir I was makingmistake in where clause variable I got correct way to give it from your query as (WHERE `id` ='".$userid."'"). So now I am able to run query as my expectation. Thank you 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.