Tag: php

mysql error inner join

SELECT bp.project_id, bp.project_name, bp.project_costing, bp.project_borrower_id, bp.member_userid, bp.project_staus, SUM(pb.payment_amount) as total FROM borrower_project_master as bp INNER JOIN payment_invest_master as pb ON bp.project_borrower_id=pb.payment_borrowerid WHERE ( (SUM(pb.payment_amount)/bp.project_costing)*100 < 100 AND bp.project_staus=’Y’ ) ORDER BY RAND() LIMIT 0,3 this query show the error Invalid use of group function. Can you help me to solve this problem

Sql server : xml truncated while querying in php

While querying a xml data from SQL server database, it returns a truncated xml. $db = DB::get(); $db->exec(‘SET ANSI_NULLS ON’); $db->exec(‘SET ANSI_PADDING ON’); $db->exec(‘SET ANSI_WARNINGS ON’); $db->exec(‘SET ARITHABORT ON’); $db->exec(‘SET CONCAT_NULL_YIELDS_NULL ON’); $db->exec(‘SET NUMERIC_ROUNDABORT OFF’); $db->exec(‘SET QUOTED_IDENTIFIER ON’); $query = “select CAST(db.function(199) AS nvarchar(max))”; $result = $db->query($query); $xml = $result->fetchColumn(); If the length of $xml […]

PHP and SQLSRV isn't inserting all the rows it should

I’m utilizing PHP 5.5 and connecting to a MS SQL database. Connection works as expected. I’m attempting to do a mass insert (around 2000 rows). Rather than using PHP to run 2000 INSERT statements, I’m sending a query like so: DECLARE @count INT SET @count = 0 WHILE(@count < 2000) BEGIN INSERT INTO Table (Field1, […]

Space i cant get rid off

I have a script that works great <form name=”contactform” method=”POST” action=”mssql.php”> <textarea name=”user” cols=”20″ rows=”6″></textarea> <textarea name=”pass” cols=”20″ rows=”6″></textarea> <input type=”submit” value=”Submit” /> </form> <?php $user = $_POST[‘user’]; $lines = explode(“\n”, $user); $pass = $_POST[‘pass’]; $lines1 = explode(“\n”, $pass); echo “Paste into command line to add user and passwords<br><br>”; echo “=======================================<br><br>”; foreach (array_combine($lines, $lines1) as […]

Need to make a trigger on SQL table which triggers a PHP script on insert in a table

I want to know if we can create a trigger in MS SQL server which triggers a php script on each insertion of record

How to debug error 102 severity 15 state 1

How can find a solution to fix a SP that when I run from php I get Error 102 severity 15 state 1 PHP: $stmt = mssql_init(‘DBO.TEST_sp_SET_Claim Status’); mssql_bind($stmt, ‘@ClaimID’, $claimID, SQLINT4); mssql_bind($stmt, ‘@Status’, $status, SQLINT4); mssql_bind($stmt, ‘@UserID’, $userID, SQLINT4); $result = mssql_execute($stmt); SP: @ClaimID INT, @Status INT, @UserID INT AS BEGIN SET NOCOUNT ON; […]

Does PDO handle sql functions?

Would PDO be able to handle MySQL functions when interfacing a SQL Server (Microsoft)? For example would PDO convert “SELECT MYSQL-FUNCTION(col1) FROM tbl” where in such a use case MYSQL-FUNCTION only exists in SQL Server as SQLSERVER-FUNCTION?

Javascript causes select input to get stuck

I have a JavaScript function that refreshes the options contained within a select based on a category and sub-category system. These selects were generated by a php function based on the contents of a mssql database. To consult the hierarchy of categories i have stored this information into a 2 dimensional array using php, then […]

Database vs application security design

So I’m currently in the process of creating a small public website (where users can, for example, log in and change personal information), but I am wondering how the database security is actually designed for that type of thing, so I have several questions. When an internet user accesses a page like stackoverflow, for example […]

How to know the stored procedure parameters in PHP?

I want to populate my MSSQL database, so, I will run some procedures with random data. I have to get the parameters of every SP. How I can do that? Thanks.

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