FTP Chmod Function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

149 Views

The ftp_chmod() function set permissions on a remote file via FTP.Syntaxftp_chmod(con, mode, my_file);Parameterscon − The FTP connectionmode − The new permissions.It consists of four numbers −The first number is always zeroThe second number specifies permissions for the OWNERThe third number specifies permissions for the OWNER's USER GROUPThe fourth number specifies permissions for EVERYBODY ELSEPossible values (to set multiple permissions, add up the following numbers) −1 = execute permissions2 = write permissions4 = read permissionsmy_file − The File nameReturnThe ftp_chmod() function returns new file permissions on success or FALSE on error.ExampleThe following is an example to set file permission by changing ... Read More

Order MySQL Records Randomly and Display Name in Ascending Order

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

296 Views

You can use subquery to order randomly and display name in asending order. The rand() is used for random, whereas ORDER BY is used to display name records in ascending order. The syntax is as follows −select *from (    select *from yourTableName order by rand() limit anyIntegerValue; ) anyVariableName order by yourColumnName;To understand the above concept, let us create a table. We have an ID as sell as Name, which we want in Ascending order. The query to create a table is as follows −mysql> create table OrderByRandName    −> (    −> Id int,    −> Name varchar(100) ... Read More

FTP Close Function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

127 Views

The ftp_close() function closes an FTP connection.Syntaxftp_close(con);Parameterscon − The connection to close.ReturnThe ftp_close() function returns TRUE on success or FALSE on failureExampleThe following is an example that login to a connection, works in it to change the directory and then connection is closed −

Equivalent of SQL Server Function SCOPE_IDENTITY in MySQL

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

2K+ Views

The equivalent of SQL Server function SCOPE_IDENTITY() is equal to LAST_INSERT_ID() in MySQL. The syntax is as follows:SELECT LAST_INSERT_ID().This returns the id of last inserted record.Here, I am going to create a table with primary key column. The following is the demo of last_insert_id().First, let us create two tables. The query to create the first table table is as follows:mysql> create table TestOnLastInsertIdDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT,    -> PRIMARY KEY(StudentId)    -> ); Query OK, 0 rows affected (0.95 sec)Now creating the second table. The query is as follows:mysql> create table TestOnLastInsertIdDemo2   ... Read More

Get Sub Map from TreeMap in Java

Samual Sam
Updated on 30-Jul-2019 22:30:24

255 Views

To get Sub Map in Java, use the submap() method. It returns the elements in a range from the Map.First, create a TreeMap and add elements −TreeMap m = new TreeMap(); m.put(1, "PHP"); m.put(2, "jQuery"); m.put(3, "JavaScript"); m.put(4, "Ruby"); m.put(5, "Java"); m.put(6, "AngularJS"); m.put(7, "ExpressJS");Now, get the Sub Map between 4 and 6 −m.subMap(4, 6)The following is an example to get Sub Map from Tree Map in JavaExample Live Demoimport java.util.*; public class Demo { public static void main(String args[]){ TreeMap m = new TreeMap(); m.put(1, ... Read More

Create Date from Day, Month, Year Fields in MySQL

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

3K+ Views

You can use in-built function STR_TO_DATE() from MySQL. The syntax is as follows −SELECT STR_TO_DATE(CONCAT(yourYearColumName, '-', LPAD(yourMonthColumName, 2, '00'), '-', LPAD(yourDayColumName, 2, '00')), '%Y-%m-%d') as anyVariableName from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table DateCreateDemo    −> (    −> `Day` varchar(2),    −> `Month` varchar(2),    −> `Year` varchar(4)    −> ); Query OK, 0 rows affected (1.68 sec)Insert values for all fields using insert command. The query is as follows −mysql> insert into DateCreateDemo values('15', '12', '2018'); Query OK, 1 row affected (0.09 ... Read More

Teach Quantitative Aptitude for SAT in India: Certification Needed?

Divya Agarwal
Updated on 30-Jul-2019 22:30:24

88 Views

There is no certification nor one required to teach Quantitative aptitude for SAT. The faculty should have the required qualification and experience though.

FTP Connect Function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

462 Views

The ftp_connect() function opens an FTB connection.Syntaxftp_connect(host,port,timeout);Parametershost − The FTP server to connect toport − The port of the FTP server. The default is 21. The host can be a domain or IP address.timeout − The timeout for network operationReturnThe ftp_connect() function returns an FTP stream on success or FALSE on errorExampleThe following is an example: to open an FTP connection, to work in it and closing it.

Add Serial Number Column in MySQL

Chandu yadav
Updated on 30-Jul-2019 22:30:24

1K+ Views

To add a new column that counts the number of rows as serial number, you can use the global variable in select statement.Let us create a table. The query to create a table is as follows:mysql> create table addColumnToCountAsSerialNumber    -> (    -> Id int,    -> Name varchar(20),    -> Age int,    -> Salary int    -> ); Query OK, 0 rows affected (0.80 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into addColumnToCountAsSerialNumber values(10, 'John', 23, 8576); Query OK, 1 row affected (0.10 sec) mysql> insert into addColumnToCountAsSerialNumber values(12, ... Read More

Meaning of the Shloka Guru Bramha Guru Vishnu

Ridhi Arora
Updated on 30-Jul-2019 22:30:24

64K+ Views

In Sanskrit, Guru word is made up of two root words Gu and Ru. Gu means darkness, and Ru means remover. Thus, guru stands for the teacher who is the remover of darkness and is the harbinger of enlightenment.What is the Guru Brahma Mantra as?The auspicious mantra recited an chanted on teacher’s day and Guru Purnima is "Guru Brahma, Guru Vishnu, Guru Devo Maheshwara; Guru Sakshat Param Brahma, Tasmai Shri Guravay Namah".Meaning of Guru Brahma MantraGuru Brahma - Guru is Brahma, who is the Lord of Creation, also called as Generator, Guru Vishnu means Guru is Vishnu (Vishnu is the ... Read More

Advertisements