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.
Tag: sqlsrv
MS SQL Native Client Login failed for user when connecting via PHP
I have a Windows 2008 R2 Datacenter server with IIS 7.5, MS SQL 2012 Express, using PHP 5.6 trying to connect to a database I created, testDB, via Windows Authentication, but am failing to do so. Here is my PHP I am using to connect to my SQL ServerInstance: When I run this I receive: Connection failed. Array ( [0]
ReturnDatesAsStrings=>true returns timestamp with decimal & zeros
I’m using PHP 7.2, MS SQL Server, fpdf, and phpSpreadsheet to create PDF and Excel reports of my data. Initially I had trouble returning the timestamp (date) fields in the reports, but adding “ReturnDatesAsStrings”=>true in my connection.php solved that problem. The issue now is that the date fields on the reports have a decimal and zeros added and show up
find active records from table based on date time in php and sql server
I need to fetch active records from my table. A record is active means it is not expired and the expiration time is 2 minutes after record is generated. I am using sql server database. Here is the structure for my table And my code is as follows I need the condition for DateGenerated as How can I implement this
Send PHP Error if No Rows Created
I’m trying to prevent duplicate rows from being created. My current statement works, meaning it prevents duplicates from being created, but it always returns the execution as a success, meaning I don’t get an “error” message if no rows were created. Thanks I would like to fail the sql execution if nothing was created, which isn’t done in this case.
PHP get return value of stored procedure
I have pleasure to work with legacy PHP application using SQL Server via PDO. How in PHP can I retrieve return value of stored procedure which is using RETURN statement as output channel? Example procedure If possible, I would prefer to not modify procedure. I am aware that there are similar questions, but they don’t cover this case Get RETURN
Fatal error: Call to undefined function mssql_connect() in C:AppServApache24htdocsC_DBHandler.inc using apache 2.4 and php5.6
i upgradefrom php version 2.2 to 2.4 and php 5.6 too. The problem is with the new php the function does not support mssql_connect so i installed the new driver for sqlsvr and when i made the Database connection it work fine. I need some help. How can I change this code from mssql to sqlsvr thanks you and i
Laravel multi result set query builder
I have a MSSQL stored procedure : And i am executing this with my laravel app : It just returns me the first SELECT query result. How can i get both result sets? Answer Solved by writing bellow function :
PHP sqlsrv_connect to SQL Server: A network-related or instance-specific error has occurred while establishing a connection to SQL Server
I want to connect PHP 7.1 to SQL Server. I add compatible drivers from: https://docs.microsoft.com/en-us/sql/connect/php/microsoft-php-driver-for-sql-server try { $serverName = “tcp:…