The SQL code below works great in MSSQL but when called via php it only outputs roughly half the results. I have tried placing this in a stored procedure and executing from php but that produces the same result as well. It should be inserting 150 rows, but I am getting only 77, sometimes 78, but it is always one
Tag: sqlsrv
How do I return multiple results from my Stored Procedure function if it returns only one result?
I have an application right now that uses SQL Server 2017. When I am executing a stored procedure on SSMS, it shows all of the data. But then, on PHP, when I am executing it, it only shows the first data that comes up. This is the command: The stored procedure I am using: PHP Code I am using: (note:
sql update multiple column in a foreach loop using prepared statement
Im studying this PHP script on how to prepare for multiple execution of a UPDATE statement. The script below shows update for 1 column using prepared statement. Example from PHP manual https://www.php.net/manual/en/function.sqlsrv-prepare.php What if I have multiple column to update, how do I create an array to bound multiple variables to a prepared statement in foreach? New update SQL statement
How to print multiple value column in PHP
I have a SQL Server database about Customer information and CustomerPhone has a multiple values column which is C_Phone. This is my code: if (!empty($_GET[‘customer_id’])){ // ‘id’ input from the …
Parameterising an IN clause in PHP with sqlsrv
I have a method which selects records based on an array of integers which works when specifically typed. However, when I try to replace that array with one passed in from the method parameter sqlsrv_query() returns false. I am sure this is something very simple, but the ‘obvious’ possibilities to me do not work. Working Version Not Working Version 1
SQLSRV skips a row when returning a query
The code above does what I want and returns number of rows that matches what the query returns. However, I hardcoded the three sqlsrv_next_result($result);. The query will change depending on @AmbassadorID, so that piece needs to be dynamic. I tried the following loop: But this loop skips the first row. How do I fix this? Thanks! Answer Use sqlsrv_has_rows(). This
SQL Server Time Format is not equal to Client Side Time format
I’m trying to compare the client side time format (“14:00”) to SQL Server time format (“14:00:00.0000000″) with SQL Query, technically is not equal because SQL Server time format has seconds and milliseconds, so I tried to concatenate the seconds and milliseconds to client side time format in PHP script like this 14:00.”:00.0000000″ and yet is not equal to SQL Server
Can Microsoft’s SQLSRV driver for PHP run on Apache?
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
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
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