Scenario: I have a PHP website running on Apache server I have an ERP system (MS SQL) that runs on a different server I need to connect from my website to that MS SQL server I need to work with Microsoft SQL Server in my PHP application. I’ve managed to get their SQLSRV driver for PHP running on my localhost
Tag: sql-server
Convert string to date datatype in SQL Server in PHP Laravel
I’m trying to get a product by id between a specific date range but the problem I’m facing is: date is in string format for some weird reason dates are stored in the database with an incomplete …
My PHP SQL Server connection doesn’t work in the browser
this is my first question so I’m trying my best to describe to you my problem, thanks. I develop a PHP script using sqlsrv library to connect to a SQL Server using a private IP in a Ubuntu (18.04) server using SSH, I installed the .so necessary for the library to work and modify my php.ini to recognize it. I
Call to undefined function odbc_connect via command line (cmd) PHP5
I’m using PHP 5, Windows (IIS), and when i try access the file from command line, i get the following error (via browser, everything works great): Fatal error: Uncaught Error: Call to undefined …
I’m not using count but my log told me “count syntax error”
I have a request who look like this in PHP: SELECT CONTACT.NOM, CONTACT.PRENOM, CONTACT.TITRE, CONTACT.COMMENT2, CONTACT.TEL, CONTACT.FAX, CONTACT.EMAIL, SERVICES.NOM …
Should one use FreeTDS driver instead of MS SQL Driver for compatibility between older PHP and newer SQL Servers?
I was struggling to connect my Drupal (7.43) application (hosted on a PHP 5.4 server) to a Microsoft Azure SQL database. I got really depressed and even found myself arguing with my company’s DBA for …
SQL – Select doesn’t retrieve results
I’m using sqlsrv_num_rows in order to check if a user exists in the DB. When i’m running the query in my DB i’m getting 1 result, but in my PHP I’m not getting anything (echo doesn’t print anything). Why is that? Example query I’m using PHP and MSSQL. Answer Explanations: Function sqlsrv_num_rows() requires a client-side, static, or keyset cursor, and
How to fetch all the data in mssql having a multiple server name by using Php And MSSQL
I have module where I need to create a cron job in php, but first thing I need to do is to fetch all the data on the table on every each server name, so now the twist here is we have a lot of server …
PHP/MSSQL: query result to table
I’m trying to return results from a MS SQL query, into a table. But somehow I only get a blanc page with the headers. I don’t know what i’m doing wrong or where to search for an answer. Could someone please direct me in the right way. Help is appreciated Answer What I think is that $dbh->query($sql) is the reason
SQL-Server Select returning null on PHP
I have a query that returns all the data while running at MSSQL, but when I try to get the result with php code it returns null SELECT: PHP CODE: Answer I’ve found the problem The problem was the encoding, I put the $query inside of utf8_encode(), and now it is returning the results. Thank you all for your time.