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
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 […]
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, […]
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 […]
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 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; […]
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?
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 […]
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.