Jump to content

php+freetds: This code runs Itself, but it dont run as part of another code...


Recommended Posts

Hi, this code is prety simple, it just query for a Inventory quantity, using php+freetds+unixodbc, and works well as I provided here, the thing is that when I put this code inside a homemade php sofware... it just returns null, none, blank, nothing... how can I workaround this?

Thanks in  advance.

 

<?php
$code = '20005-FRD';
include "/usr/local/www/data/scripts/db_stuff/db_secrets.php";
$conn=odbc_connect($pos_host,$pos_user,$pos_pass);
$queryRMSqty1 = "SELECT Quantity FROM Custom_Piso_Qty WHERE SubDescription3 = '".$code."'";
$rs_RMS1=odbc_exec($conn,$queryRMSqty1);
$RMS_qty1=odbc_result($rs_RMS1,'Quantity');
echo $RMS_qty1;
odbc_free_result($rs_RMS1);
odbc_close($conn);
?>

 

 

Aldo

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.