> Delete from MyClass where id=1;Here is a comparison of the table before and after deleting the data.
FirstName
LastName
Age
Peter
Griffin
35
Glenn
Quagmire
33
The following is an example of PHP code to delete all Lastname= ' Griffin ' records in the "Persons" table: After this deletion, the table is like this:
Griffin
35
Glenn
Quagmire
33
The following is an example of PHP code to delete all Lastname= ' Griffin ' records in the "Persons" table:After this deletion, the table is like this:
FirstName
LastName
Age
Glenn
Quagmire
33
5.7 Modify data syntax in table: Update table name SET field = new value,... w
of the table before and after deleting the data.
FirstName
LastName
Age
Peter
Griffin
35
Glenn
Quagmire
33
The following is an example of PHP code to delete all Lastname= ' Griffin ' records in the "Persons" table: After this deletion, the table is like this:
FirstName
LastName
Age
table before and after deleting the data.
FirstName
LastName
Age
Peter
Griffin
35
Glenn
Quagmire
33
The following is an example of PHP code to delete all Lastname= ' Griffin ' records in the "Persons" table: After this deletion, the table is like this:
FirstName
LastName
Age
comparison of the table before and after deleting the data.
FirstName
LastName
Age
Peter
Griffin
35
Glenn
Quagmire
33
The following is an example of PHP code to delete all Lastname= ' Griffin ' records in the "Persons" table:After this deletion, the table is like this:
FirstName
LastName
Age
typically used with where to query for more accurate and complex data. 5.6 Delete Table Data command: Delete from table name where expressionExample: Deleting a record with number 1 in table MyClassMysql> Delete from MyClass where id=1;Here is a comparison of the table before and after deleting the data.
FirstName
LastName
Age
Peter
Griffin
35
Glenn
Quagmire
33
Th
of this commandListing 5. Output of MIN () queryThis command shows all non-redundant data, and other lines should be deleted.ID LASTNAME FIRSTNAME------------------------------1018 Blake Becky1013 Blue Don1000 Bradley Tom1002 Chang Jim1008 Griffin David1020 Hill Larry1004 King Chuck1005 Krieger Jeff1003 Loney Julie1007 Lord Don1015 Mason Paul1006 Monroe John1009 Simon MichaelStone Tony 1001
14 rows selected.
In this way, you can delete all rows not i
This article describes how to control the vertical alignment of table row content in javascript. you can use getElementById of javascript to obtain elements and set corresponding styles, for more information about how to control the vertical alignment of table row content in JavaScript, see the following example. Share it with you for your reference. The specific analysis is as follows:
The following code uses the vAlign attribute of the table to control the vertical alignment of the content
The process of learning PHP, sorting out some of the commonly used functions, which are array functions.Array (): Generate an array$a = Array ("Dog", "cat", "horse");Print_r ($a); Array ([0] = dog [1] = cat [2] = = horse)Array_combine (): Generates an array with the value of an array as the key name, and the value of the other array as the value$a 1 = Array ("A", "B", "C", "D");$a 2 = Array ("Cat", "Dog", "Horse", "Cow");Print_r (Array_combine ($a 1, $a 2)); Array ([A] = Cat [b] = Dog [c] = Hors
Delete PHP MySQL Data
The DELETE statement is used to record the deletion table.Delete data from a databaseThis statement is used to delete records from the database table.Syntax
DELETE FROM table_name WHERE some_column = some_value
Note: Pay attention to the delete syntax in the WHERE clause. The records or records specified by the WHERE clause should be deleted.If you ignore the WHERE clause, all records will be deleted!For more information about SQL, see our SQL tutorial.To allow PHP to exec
parameter holds the content of the requested page, and the status callback parameter holds the requested State$.post (Url,data,callback);The required URL parameter specifies the URL that you want to request.The optional data parameter specifies the information to be sent along with the request.The optional callback parameter is the name of the function that executes after the request succeeds. two parameters ibid.Instance:Background database data:
ID
FirstName
LastName
looks like this:
FirstName LastName Age
Peter Griffin 35
Glenn Quagmire 33
The following example deletes all records whose LastName is 'grigin' in the "Person" table:
$ Con = mysql_connect ("localhost", "peter", "abc123 ");
If (! $ Con)
{
Die ('could not connect: '. mysql_error ());
}
Mysql_select_db ("my_db", $ con );
Mysql_query ("delete from Person WHERE LastName = 'grigin '");
Mysql_close ($ con );
?>
After this deletion, the table is as follows:
PHP array usage tutorial. When using PHP for development, you need to create many similar variables either early or late. Without many similar variables, you can store data as elements in an array. When using PHP for development, you need to create many similar variables either early or late.
Without many similar variables, you can store data as elements in an array.
All elements in the array have their own IDs, so they can be easily accessed.
There are three types of arrays:
Numeric array
Arra
arrayDefine the format:Array Compact (VAR1,VAR2 ...)Example 1: Any string that has no variable name corresponding to it is skipped.
The code is as follows:
Output Result:
The code is as follows:
Array ([FirstName] = Peter [LastName] = Griffin [age] + 38)
Example 2: Using a string with no corresponding variable name, and a variable an array group
The code is as follows:
Output Result:
The code is as follows:
Array ([FirstName] = Peter [LastName] =
from the record set in the form of an array, each subsequent call to the mysql_fetch_array () function will return the next row in the record set. the while loop statement will record all records in the set cyclically. to output the values of each row, we use the $ row variable of PHP ($ row ['firstname'] and $ row ['lastname']).
Output of the above code:
Peter Griffin
Glenn Quagmire
The result is displayed in an HTML table. The data selected in the
this:
ID
Firstname
Lastname
Age
Hometown
Job
1
Peter
Griffin in
41
Quahog
Brewery
2
Lois
Griffin in
40
Newport
Piano Teacher
3
Joseph
Swanson
39
Quahog
Police Officer
4
Glenn
Quagmire
41
Quahog
Pilot
HTML form
The preceding example conta
['Peter '] = "32 "; $ ages ['quagmire'] = "30"; $ ages ['job'] = "34"; you can use the ID key in the script:
Output of the above script: Peter is 32 years old. multi-dimensional array in multi-dimensional array, each element in the main array is also an array. Each element in the sub-array can also be an array, and so on. Example 1 in this example, we create a multidimensional array with an automatically assigned ID key: $ families = array ("Griffin
another way to create an array: $ ages ['Peter '] = "32 "; $ ages ['quagmire'] = "30"; $ ages ['job'] = "34"; you can use the ID key in the script:
Output of the above script: Peter is 32 years old. multi-dimensional array in multi-dimensional array, each element in the main array is also an array. Each element in the sub-array can also be an array, and so on. Example 1 in this example, we create a multidimensional array with an automatically assigned ID key: $ families = array ("
The process of learning PHP, sorting out some of the commonly used functions, which are array functions.
Array (): Generate an array$a = Array ("Dog", "cat", "horse");Print_r ($a); Array ([0] = dog [1] = cat [2] = = horse)Array_combine (): Generates an array with the value of an array as the key name, and the value of the other array as the value$a 1 = Array ("A", "B", "C", "D");$a 2 = Array ("Cat", "Dog", "Horse", "Cow");Print_r (Array_combine ($a 1, $a 2)); Array ([A] = Cat [b] = Dog [c]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.