Separate and Select String Values with Hyphen in MySQL

AmitDiwan
Updated on 31-Dec-2019 07:25:49

508 Views

For this, you can use SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable1962    (    EmployeeInformation text    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1962 values('101-John-29'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1962 values('102-David-35'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1962 values('103-Chris-28'); Query OK, 1 row affected (0.00 sec)Display all records from the table using select statement −mysql> select * from DemoTable1962;This will produce the following output −+---------------------+ | EmployeeInformation | +---------------------+ | 101-John-29   ... Read More

jQuery fadeOut() Method

AmitDiwan
Updated on 31-Dec-2019 07:24:54

253 Views

The fadeout() method in jQuery is used to give a fading effect by changing the opacity for the selected elements. The fading effect changes from visible to hidden.SyntaxThe syntax is as follows −$(selector).fadeOut(speed, easing, callback)Above, the parameter speed is the speed of the fading effect. Here, easing is the speed of the element in different points of the animation, whereas callback is a function to be executed after fadeOut() completes.ExampleLet us now see an example to implement the jQuery fadeout() method − Live Demo    $(document).ready(function(){       $("button").click(function(){          $("h2").fadeOut();       ... Read More

imagearc Function in PHP

Arjun Thakur
Updated on 31-Dec-2019 07:24:38

361 Views

The imagearc() function is used to draw an arc.Syntaximagearc( $img, $cx, $cy, $width, $height, $start, $end, $color )Parameters$img: Creates an image with imagecreatetruecolor().$cx: x-coordinate of the center.$cy: y-coordinate of the center.$width: The width of arc.$height: The height of arc.$start: The arc start angle, in degrees.$end: The arc end angle in degrees.$color: It sets the color of image.ReturnThe imagearc() function returns the TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:ExampleLet us see another example wherein we have different coordinates and angle for arc:OutputThe following is the output:Read More

ImageColorClosest Function in PHP

George John
Updated on 31-Dec-2019 07:23:04

107 Views

The imagecolorclosest() function gets the index of the closest color to the specified color.Syntaximagecolorallocatealpha (img, red, green, blue)Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorclosest() function returns the index of the closest color, in the palette of the image.ExampleThe following is an example: Live Demo

Parse String to Get Number from Large String Separated by Underscore

AmitDiwan
Updated on 31-Dec-2019 07:22:24

125 Views

Let us first create a table −mysql> create table DemoTable1961    (    Title text    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1961 values('You_can_remove_the_string_part_only-10001-But_You_can_not_remove_the_numeric_parts'); Query OK, 1 row affected (0.00 sec)Display all records from the table using select statement −mysql> select * from DemoTable1961;This will produce the following output −+------------------------------------------------------------------------------------+ | Title                                                                       ... Read More

imagecolorallocatealpha Function in PHP

Ankith Reddy
Updated on 31-Dec-2019 07:22:02

258 Views

The imagecolorallocatealpha() function allocates a color for an image.Syntaximagecolorallocatealpha ( img, red, green, blue, alpha )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentalpha: The transparency of image, with 0 indicating completely opaque, whereas 127 indicating completely transparent.ReturnThe imagecolorallocatealpha() function returns a color identifier or FALSE if the allocation failed.ExampleThe following is an example:OutputThe following is the output:

jQuery Hide with Examples

AmitDiwan
Updated on 31-Dec-2019 07:21:27

310 Views

The hide() method in jQuery is used to hide selected elements.SyntaxThe syntax is as follows −$(selector).hide(speed, easing, callback)Above, the parameter speed is the speed of the hide effect, whereas easing is the speed of the element in different points of the animation. The callback function is a function that executes after hide() method completes.ExampleLet us now see an example to implement the jQuery hide() method  − Live Demo    $(document).ready(function(){       $(".btnhide").click(function(){          $("p").hide();       });       $(".btnshow").click(function(){          $("p").show();       });   ... Read More

imagecolorallocate Function in PHP

Chandu yadav
Updated on 31-Dec-2019 07:21:19

600 Views

The imagecolorallocate() function allocates a color for an image.Syntaxint imagecolorallocate ( $img, $red, $green, $blue )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorallocate() function returns a color in RGB format.ExampleThe following is an example:OutputThe following is the output:

imagecolorexact Function in PHP

Arjun Thakur
Updated on 31-Dec-2019 07:20:41

90 Views

The imagecolorexact() function gets the index of the specified color.Syntaximagecolorexact ( $img, $red, $green, $blue )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorexact() function returns the index of the specified color in the palette, or -1 if the color does not exist.ExampleThe following is an example: Live DemoOutputThe following is the output:Array ( [0] => 1989170 [1] => 5273700 [2] => 1658930 )

ImageColorClosestHWB Function in PHP

George John
Updated on 31-Dec-2019 07:20:04

63 Views

The imagecolorclosesthwb() function gets the index of the color which has the hue, white and blacknessSyntaximagecolorclosesthwb ( $img, $red, $green, $blue )Parametersimg: Create image with imagecreatetruecolor()red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorclosesthwb() function returns an integer with the index of the color which has the hue, white and blackness nearest the given color.ExampleThe following is an example: Live DemoOutputThe following is the output:HWB = 87

Advertisements