Jump to content

About mysql query


amol.karande

Recommended Posts

$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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated