[Solved] displaying XML to html after retrieving from SQL 2014 XML column [closed]

The code would look something like the code below. You need to modify the connection string and SQL as required. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.SqlClient; namespace ConsoleApplication58 { class Program { static void Main(string[] args) { string connStr = “Enter Your Conneciton String Here”; string SQL = “Select … Read more

[Solved] select id by the min and max (sql) [closed]

You can use the MAX() and MIN() function to get the ids having largest and the id having smallest discount. Select id,discount from customer where discount=(select MAX(discount) from customer) OR discount=(select MIN(discount) from customer); 3 solved select id by the min and max (sql) [closed]

[Solved] How to compare date time in range with hour [closed]

Try something like this. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Globalization; namespace ConsoleApplication59 { class Program { static void Main(string[] args) { DateTime time = DateTime.ParseExact((“26-12-2017 5:45pm”).ToUpper(),”dd-MM-yyyy h:mmtt”, CultureInfo.InvariantCulture); int dayOfWeek = (int)time.DayOfWeek; DateTime saturdaySundayMidnight = time.AddDays(-dayOfWeek).Date; TimeSpan timeOfWeek = time.Subtract(saturdaySundayMidnight); TimeSpan startTime = new TimeSpan(1,17,45,0); //Monday 5:45PM TimeSpan endTime = new … Read more

[Solved] Why the code does not work?

This line $link=mysqli_connect(‘host’,’username’,’password’,’database_name’); should be: $link=mysqli_connect($host,$username$,$password,$database_name); solved Why the code does not work?

[Solved] PHP: How to get the page name of an url

<?php $url=”http://username:password@hostname:9090/path?arg=value#anchor”; var_dump(parse_url($url)); var_dump(parse_url($url, PHP_URL_SCHEME)); var_dump(parse_url($url, PHP_URL_USER)); var_dump(parse_url($url, PHP_URL_PASS)); var_dump(parse_url($url, PHP_URL_HOST)); var_dump(parse_url($url, PHP_URL_PORT)); var_dump(parse_url($url, PHP_URL_PATH)); var_dump(parse_url($url, PHP_URL_QUERY)); var_dump(parse_url($url, PHP_URL_FRAGMENT)); ?> Parse_url is what you’re searching for ! The scheme here would be “PHP_URL_PATH” I guess Some doc : http://php.net/manual/en/function.parse-url.php 2 solved PHP: How to get the page name of an url

[Solved] SQL – Differences between two queries

The only difference is that the first query will return a row for each pair of rows in the table where P1.att2 > P2.att2 and P2.att1 = x, while the second query will just return one row for each row in the table where att2 is greater than in some row where att1 = x. … Read more

[Solved] How do I successfully pass in a parameter in this onclick function? Uncaught ReferenceError: B081517B is not defined [duplicate]

You’d have to convert your date string to a timestamp (milliseconds since 1-1-1970). Then you could do the same to the current date and compare the two (subtracting one from another). With the difference in milliseconds, you can calculate the amount of hours by dividing it by the amount of milliseconds that are in one … Read more

[Solved] Stored procedures in SQL Server 2012 [closed]

Try using xml methods, DECLARE @xml XML, @mlt_sk VARCHAR(100)=’7,11,12′, @GroupName VARCHAR(10)=’xyz’, @delimiter VARCHAR(10)=’,’ — Converting string to XML SET @xml = Cast(( ‘<X>’ + Replace(@mlt_sk, @delimiter, ‘</X><X>’) + ‘</X>’ ) AS XML) –SELECT @xml DECLARE @YOUR_TABLE AS TABLE ( VALUE VARCHAR(100) ) ——–Use nodes() method INSERT INTO @YOUR_TABLE SELECT N.value(‘.’, ‘varchar(10)’) + ‘-‘ + @GroupName … Read more

[Solved] Numbers only password strength [closed]

The regular expression is: ^((?!(?<ch>.)\k<ch>\k<ch>)(?!012|123|234|345|456|567|678|789|890)[0-9]){8,}$ The (?!(?<ch>.)\k<ch>\k<ch>) will check for the same character repeated thrice. Note that for the various contiguous sequences I had to put them in a list of possible sequences, (?!012|123|234|345|456|567|678|789|890). [0-9] is the character that will be accepted as valid. The {8,} is for the minimum length. 1 solved Numbers only … Read more