intlchar_isalnum Function in PHP

Samual Sam
Updated on 30-Dec-2019 07:36:57

185 Views

The IntlChar::isalnum() function is used to check the given input is an alphanumeric character or not. The alphanumeric character is a digit or letter.Syntaxbool IntlChar::isalnum(val)Parametersval − An integer values or character encoded as a UTF-8 string.ReturnThe IntlChar::isalnum()function returns TRUE if the val is alphanumeric.ExampleThe following is an example −OutputThe following is the output −NULL NULL NULL bool(true)ExampleLet us see another example −OutputThe following is the output −bool(false) bool(true)

jQuery Traversing Siblings

AmitDiwan
Updated on 30-Dec-2019 07:36:19

195 Views

With jQuery, you can easily find siblings of an element using the following methods: next(), nextAll(), prev(), prevAll(), siblings(), etc. Let us see some of them traverse siblings−next() methodThe next() method is used to return the next sibling element of the selected element. Let us see an example−Example Live Demo div {    width:600px; } .demo * {    display: block;    border: 2px solid orange;    color: blue;    padding: 10px;    margin: 10px; }    $(document).ready(function(){       $("h3").next().css({"color": "gray", "border": "3px dashed blue"});    }); parent sibling ... Read More

Insert Data in a Table using MySQL Stored Procedure

AmitDiwan
Updated on 30-Dec-2019 07:33:13

3K+ Views

To insert in a table in stored procedure, the syntax is as follows −create procedure yourProcedureName(OptionalParameter)    begin    insert into yourTableName() values(yourValue1, yourValue2, ...N); endTo understand the above syntax, let us first create a table −mysql> create table DemoTable1928    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(20),    Age int    ); Query OK, 0 rows affected (0.00 sec)Here is the query to create a stored procedure −mysql> delimiter // mysql> create procedure insert_demo(IN Name varchar(40), IN Age int)    begin    insert into DemoTable1928(Name, Age) values(Name, Age);    end    // Query OK, ... Read More

Display First Non-Null Values with COALESCE in MySQL

AmitDiwan
Updated on 30-Dec-2019 07:31:04

497 Views

The coalesce() can be used to print first NOT NULL column value. Let us first create a table −mysql> create table DemoTable1927    (    StudentName varchar(20),    StudentSubject varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1927 values('Chris', 'MySQL'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1927 values('David', NULL); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1927 values(NULL, 'MongoDB'); Query OK, 1 row affected (0.00 sec)Display all records from the table using select statement −mysql> select * from DemoTable1927;This will ... Read More

jQuery Traversing Descendants

AmitDiwan
Updated on 30-Dec-2019 07:30:10

128 Views

To traverse and find descendants of an element, jQuery has the following methods: children() and find().children() methodThe childreb() method in jQuery is used to return the direct children of the selected element (only a single level of direct children). Let us see an example−Example Live Demo div {    width:600px; } .demo * {    display: block;    border: 2px solid orange;    color: blue;    padding: 10px;    margin: 10px; }    $(document).ready(function(){       $("div").children().css({"color": "gray", "border": "3px dashed blue"});    }); great-great-grandparent great-grandparent grandparent parent span ... Read More

Select Rows with Randomized Initial Ones and Ordered by Criteria in MySQL

AmitDiwan
Updated on 30-Dec-2019 07:28:20

121 Views

For this, you can use ORDER BY CASE statement. Let us create a table −mysql> create table DemoTable1926    (    Position varchar(20),    Number int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1926 values('Highest', 50); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1926 values('Highest', 30); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1926 values('Lowest', 100); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1926 values('Lowest', 120); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1926 values('Lowest', ... Read More

Check If a String Starts with Given Word in PHP

karthikeya Boyini
Updated on 30-Dec-2019 07:24:01

755 Views

Create a function to check whether a string begins with the specified string or not. The function should return TRUE on success or FALSE on failure.The following is the syntax −begnWith(str, begnStr)Consider the following parameters in it to check −str − The string to be testedbegnStr − The text to be searched in the beginning of the specified string.ExampleThe following is an example − Live Demo

Update Specific Column Value Using CASE Statement

AmitDiwan
Updated on 30-Dec-2019 07:22:10

145 Views

For this, use UPDATE command along with CASE statement. Let us first create a table −mysql> create table DemoTable1925    (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentName varchar(20),    StudentMarks int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1925(StudentName, StudentMarks) values('Chris', 98); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1925(StudentName, StudentMarks) values('David', 45); Query OK, 1 row affected (0.00 sec)Display all records from the table using select statement −mysql> select * from DemoTable1925;This will produce the following output −+-----------+-------------+--------------+ | ... Read More

Update Records in a Table with Specific Year from Date Format

AmitDiwan
Updated on 30-Dec-2019 07:20:19

149 Views

To update records with a specific year, use the YEAR() method as in the below syntax:update yourTableName set yourColumnName1=yourValue1 where YEAR(str_to_date(yourColumnName2, '%d/%m/%Y'))=yourValue2;Let us first create a table −mysql> create table DemoTable1924    (    UserName varchar(20),    UserJoiningDate varchar(40)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1924 values('Chris', '10/12/2010'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1924 values('David', '20/01/2011'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1924 values('Mike', '20/01/2010'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1924 values('Carol', ... Read More

jQuery mouseup() with Examples

AmitDiwan
Updated on 30-Dec-2019 07:19:20

405 Views

The mouseup() method in jQuery is used to trigger the mouseup event. The event occurs when the left mouse button is releases over the selected element.SyntaxThe syntax is as follows−$(selector).mousedown(func)Above, func is the function to run when mouseup event triggers.ExampleLet us now see an example to implement the jQuery mouseup() method − Live Demo    $(document).ready(function(){       $("h2").mouseup(function(){          $(this).after("Mouse up (mouse button is released).");       });       $("h2").mousedown(function(){          $(this).after("Mouse down (mouse button is pressed down).");       });    }); ... Read More

Advertisements