Jump to content

twdavis

New Members
  • Posts

    5
  • Joined

  • Last visited

twdavis's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. I deleted the swl user and created a new on e and it fix the problem. Thanks
  2. Run this code pointing to the new SQL server I get and error. But pointing to the old SQL server it works fine. and line 24 is the odbc_connect. Error: Warning: odbc_exec(): SQL error: [FreeTDS] The cursor was not declared., SQL state 37000 in SQLExecDirect in /var/www/html/V9/bs_kf_orders_shipped_sum1.php on line 24 Error in SQL <?php include 'connection.php';?> </head> <body> <?php $gr_total = 0; $total=0; $sql=" select impPartClassID,sum(omlExtendedPriceBase) as Total1 ,sum(omlQuantityShipped) as qty from m1_kf.dbo.SalesOrders left outer join m1_kf.dbo.SalesOrderLines on omlSalesOrderID=ompSalesOrderID Left Outer join m1_kf.dbo.Parts on impPartID=omlpartid LEFT JOIN m1_KF.dbo.Organizations og ON cmoOrganizationID = ompShipOrganizationID where ompcloseddate= '12-05-2023' and omlQuantityShipped !=0 group by impPartClassID"; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } while ($row = odbc_fetch_array($result)) { echo "<tr><td>" . $row['impPartClassID'] ."</td>"; echo "<td>" . number_format($row['Total1'],2) ." "."</td>"; echo "<td>" ." Qty ".number_format($row['qty'],0)."<br></td></tr>"; $total = $total + $row['Total1']; } odbc_close($connect); $gr_total=number_format($total,2); echo "Total"." ". $gr_total ?>
  3. I have the odbc extension installed and can connect to sql server 2008 with no problem. in this same connection page if I change to the old server is works fine.
  4. PHP Fatal error: Uncaught Error: Call to undefined function odbc_connect() in /var/www/html/V9/connection.php:19 Stack trace: #0 {main} thrown in /var/www/html/V9/connection.phpI get this error from PHP Connection my php Connect <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); //echo "Connection page"; $name = 'kf-m1'; $user = 'user'; $password = 'password'; $hostname='ipaddress'; $dbname='M1_KF'; $username='user'; $password='password'; $connect =odbc_connect($name,$user,$password); if(!$connect) { exit("Connection Failed: " . $connect); }; ?>
  5. I can connect to the sql server 2019 from my linux machine with tsql but not with isql or with PHP odbc_connect. I can connect to older SQL Servers. I have tried a lot of different thing including FreeTDS. isql error is [ISQL]ERROR: Could not SQLConnect my odbcinst.ini [FreeTDS] Description=FreeTDS Driver Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so [ODBC Driver 18 for SQL Server] Description=Microsoft ODBC Driver 18 for SQL Server Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.3.so.2.1 UsageCount=1 [ODBC Driver 17 for SQL Server] Description=Microsoft ODBC Driver 17 for SQL Server Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.5.1 UsageCount=1 My odbc.ini [KF-M1] Driver=FreeTDS Trace=Yes Servername=KF-M1 Database=M1_KF
×
×
  • 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.