Tutorialspoint

Best way to test if a row exists in a MySQL table

Ankith Reddy
Answered on 18th Oct, 2018

To test whether a row exists in a MySQL table or not, use exists condition. The exists condition can be used with subquery. It returns true when row exists in the table, otherwise false is returned. True is represented in the form of 1 and false is represented as 0. ... Read More

MySQL Error - #1046 - No database selected

Maheshwari Thakur
Answered on 18th Oct, 2018

The error-#1046 can occur when we are creating a table, but forget to select the database. Let us say we have started MySQL as shown below − After giving the correct password, the above window will open. Now create a table without choosing any database. This will show an ... Read More

How to take backup of a single table in a MySQL database?

George John
Answered on 18th Oct, 2018

The backup of a table can be made with the help of backup table as well as mysqldump utility. The backup table concept was used in MySQL version 5.0 and its earlier version. Here, I am performing backup with the help of mysqldump. Firstly, we will open cmd with the ... Read More

wordwrap() function in PHP

Samual Sam
Answered on 17th Oct, 2018

The wordwrap() function in PHP wraps a string into new lines when it reaches a specific length. Syntax wordwrap(str, width, break, cut) Parameters str − The specified string width − The maximum line width. The default is 75 break − The characters to use as break. The ... Read More

vsprintf() function in PHP

Maheshwari Thakur
Answered on 17th Oct, 2018

The vsprint() function returns the formatted string. Syntax vsprintf(format, argarray) Parameters format − Specifies the string and how to format the variables in it. The following are the possible format values − %% − Returns a percent sign %b − Binary number %c ... Read More

vprintf() function in PHP

karthikeya Boyini
Answered on 17th Oct, 2018

The vprintf() function is used to convert string to formatted string. It outputs a formatted string. Syntax vprintf(format, arg) Parameters forma − Specifies the string and how to format the variables in it. The following are the possible format values − %% - Returns a percent ... Read More

vfprintf() function in PHP

George John
Answered on 17th Oct, 2018

The vfprintf() function is used to convert formatted string to specific output. It returns the length of the outputted string. Syntax vfprintf(stream, format, arg) Parameters stream − Specifies where to output the string format − Specifies the string and how to format the variables in ... Read More

ucwords() function in PHP

Samual Sam
Answered on 17th Oct, 2018

The ucwords() function is used to convert the first character of a string to uppercase in each string. Syntax ucwords(str) Parameters str − The specified string Return The ucfirst() function returns the converted string. The following is an example − Example Live Demo ... Read More

ucfirst() function in PHP

Maheshwari Thakur
Answered on 17th Oct, 2018

The ucfirst() function is used to convert the first character of a string to uppercase. Syntax ucfirst(str) Parameters str − The specified string Return The ucfirst() function returns the converted string. Example The following is an example − Live Demo <?php echo ucfirst("demo"); ?> Output Demo

trim() function in PHP

karthikeya Boyini
Answered on 17th Oct, 2018

The trim() function is used to remove whitespaces and other characters. Syntax trim(str, charlist): Parameters str − Specify the string to check. charlist − Specifies which characters to remove. If this parameter isn’t used, then any of the following characters are removed − "\0" - ... Read More

substr() function in PHP

Ankith Reddy
Answered on 17th Oct, 2018

The substr() function is used to return a part of a string. Syntax substr(str, begin, len) Parameters str − The string begin − Specifies where to begin in the string A positive number − Start at a specified position in the string A negative ... Read More

substr_replace() function in PHP

Samual Sam
Answered on 17th Oct, 2018

The substr_replace() function is used to replace the part of string with another string. Syntax substr_replace(str, replacement, begin, len) Parameters str − The string to check replacement − The string to insert begin − The position from where the replacement begins − If begin is a ... Read More

substr_count() function in PHP

Chandu yadav
Answered on 17th Oct, 2018

The substr_count() function is used to count the number of sub-strings. Syntax substr_count(str, substr, begin, len) Parameters str − The string to check substr − The string to search for begin − Where to begin searching in the string len − The length ... Read More

substr_compare() function in PHP

karthikeya Boyini
Answered on 17th Oct, 2018

The substr_compare() function is used to compare two string format with a specific start position. Syntax substr_compare(str1, str2, offset, len, case_insensitive) Parameters str1 − The first string to compare str2 − The second string to compare offset − The start position for the comparison. If negative, the ... Read More

strtr() function in PHP

Ankith Reddy
Answered on 17th Oct, 2018

The strstr() is used to translate a character or replace substring. Syntax strstr(str, from, to) or strstr(str, arr) Parameters str − The string to translate from − The characters to change. A required parameter if array is not used. to − The characters to ... Read More

Previous 1 ... 3 4 5 6 7 8 9 ... 827 Next
Advertisements
Loading...
Unanswered Questions View All