Skip to content
Advertisement

Tag: sql-server

SQL (sqlsrv) Cursor not finishing when execute from PHP

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

PHP unable to identify sqlsrv_connect() function while trying to connect SQL Server

I’m trying to connect to my local SQL Server from a simple PHP file using the sqlsrv_connect() function, but every time I’m calling the file in the browser through localhost, it’s throwing a 500 (Internal Server Error) saying: PHP Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:inetpubwwwrootAJAX_Tutorialget_db_data.php:4 get_db_data.php is the file from which I’m trying to connect

SQL to .csv – How to Get Rid of Double Array Entries

I’m using php code to get the values from a database table with 3 columns and put them into a .csv file The problem is that I’m always getting double entries of every column. Here is the first row that shows the problem. The array should be 3 items but it is 6. Here is how I’m getting the above

Laravel 8.54.0 + Livewire : Error SQLSTATE[IMSSP] Tried to bind parameter number 2101. SQL Server supports a maximum of 2100 parameters

I use Laravel Framework 8.54.0 and livewire. I want to call data for my dropdown form. But I get sqlstate error. Could anyone help me find a way to solve this issue? Model: Livewire Controller: View: Answer it says you have more than 2100 records so the query should contain all of them in where query!! Well in some sql

laravel 8 migration error: Unknown column ‘batch’ in ‘order clause’ (SQL: select `migration` from `migrations` order by `batch` asc, `migration` asc)

[SOLVED] i new to Laravel and PHP. i tried to migrate my own migrations but i can’t. this my laravel and php information: my php info PHP 8.0.3 (cli) (built: Mar 4 2021 05:33:14) ( NTS ) Composer version 2.0.11 2021-02-24 Laravel 8.x mysql Server version: 10.5.9-MariaDB Arch Linux my OS info uname: Linux ali 5.4.105-1-MANJARO #1 SMP PREEMPT 2021

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

Login timeout expired with PDO sqlsrv connection. Able to query with TSQL just fine from same RHEL 8 client

I’m getting “Login timeout expired” with the following connection attempt: If I add LoginTimeout: The script returns a Bad Gateway error. I’m at my wits end and am unsure what I’m missing. Details below. This is a RHEL 8.3 system with PHP 7.4.6 installed. RemoteSQLServer is a remote Windows system running SQLServer 2012. I’m able to successfully connect just to

Advertisement