Tag: php

how can i use variable table $r1 in the query $r2 instead of table name on FROM clause in php file

$r1 = mysqli_query($con,”SELECT course_id,status FROM attendance WHERE stud_id = ‘$stud_id'”); $r2 = mysqli_query($con,”SELECT course_name,status FROM **$r1** NATURAL JOIN course WHERE stud_id = ‘$stud_id'”);

How to change SQL-SERVER table column name encoding?

I’m in a project of creating a Japanese website using Laravel 5.4. The database is SQL-SERVER 2014, and the name of columns in almost all tables are in Japanese. The problem is in the result Laravel retrieves from those tables in SQL-SERVER, the column names are in SJIS while the table contents is in UTF-8. […]

Is it possible to connect with php to a named instance mssql

Is it possible to connect from php 7.1 to a mssql server named instance with msphpsql https://github.com/Microsoft/msphpsql they say Connection using named instances using ” is not supported. what do they mean with ”?

Issues trying to connect to a remote Microsoft SQL Server with PHP using PDO

I am trying to make a simple web application using just HTML5, CSS, Javascript, and PHP. The purpose of the app is to pull data off of a remote Microsoft SQL Server Database and put the data in a schedule table based primarily off of date. I have most of my frameworking up, I am […]

how to properly get a blob(MAX) image from SQL db

When i try to get a image as blob i get this response: The Response content must be a string or object implementing __toString(), "boolean" given. my code is as following, The GET query function GET_shopimages($shopid){ $currentUserName = Auth::user()->name; $query = “SELECT * FROM srms_dam.dbo.pictures WHERE srms_dam.dbo.pictures.shopid = (?) “; $parameters = array((int) $shopid); return […]

How to insert all the SQL table data into an array in java

I’m trying to get all the data in my sql server table and to insert it into an array. My table’s name is “users” and I want to get all the names and emails and put them inside an array like that: [name,email,name,email,name,email……] I used volley while POSTING data to my sql server but i […]

What are the compatible versions of PHP and SQLSRV driver for SQL Server 2000?

I’m using the following: PHP = 7.0.18 pdo_sqlsrv = 4.2.0-preview+9718 and I need to connect it to SQL server 2000. I tried it with 2008 and it worked. My error with 2000: Connection error: SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]ODBC Driver 11 for SQL Server does not support connections to SQL Server 2000 or […]

Write nested Select queries for same table in Zend Framework2

Following is my query SELECT d.[today date], d.mydatediff,d.cc_exp FROM ( SELECT GETDATE() AS ‘today date’, cc_exp, DATEDIFF(DAY, CONVERT(DATE, DATEADD(DAY, -1, DATEADD(MONTH, 1, CONVERT(DATETIME, ‘1/’ + cc_exp, 103)))), GETDATE()) AS mydatediff, [customer_member_id] FROM [ats].[dbo].[customers] WHERE cc_exp IS NOT NULL AND customer_member_id IN (‘11111′,’2222′,’33333’) ) d WHERE d.mydatediff BETWEEN 30 AND 100 ORDER BY d.mydatediff DESC I […]

Codeigniter add space in query that's why it return wrong total + mysql?

I have to count commaseprated values from my table for that i run this query $this->db->select(‘*, LENGTH(members_id) – LENGTH(REPLACE(members_id,”,”,””)) + 2 as total’,false); $query = $this->db->get(‘group’); $res = $query->result_array(); when it execute query it should be like LENGTH(REPLACE(members_id,”,”,””)) but it add space near “,” and chage it to “, “ after added space query will […]

I am not able to make connection to database having SQL Server in laravel 5.3?

I am trying to connect to database having SQL Server DBMS but my connection is unsuccessful with following error in the screen shot? This is the code I am having: public function getTest(Request $request) { $db_ext = DB::connection(‘sqlsrv’); $user = $db_ext->table(‘HR.DtlEmployeeDetails’)->get(); print_r($user); }

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.