Mysql Tag Name | Mysql Tags | Usage |
---|---|---|
Mysqli Data types | ||
Integers | int and float | integer = whole number float = decimal. |
String | char, varchar, and text | char = letters only.
varchar = letters and numbers. text = text usually a large block of text. |
Blob | Blob | A field for large amount of text or images. |
Time | time = hh:mm:ss format. date = CCYY-MM-DD format | time and date |
DateTime | YYYY-MM-DD HH:MM:SS | A date and time combination shows time data input. |
Timestamp | ( YYYYMMDDHHMMSS ) | shows year, month, day, hours, minutes, and seconds data input. |
Mysqli Queries | ||
Insert Statement | INSERT INTO music ( field1, field2,...field3 ) VALUES ( value1, value2,...value3 ); | Inserts data into specific columns in your table. |
Select Statement | SELECT column_name(s) FROM music or SELECT * FROM music | selects specific data from specific columns your database. If you want all data use the '*'. |
Modify Statement | UPDATE music SET field1 = new-value1, field2 = new-value2 [WHERE Clause] | Modifies specific data in specific columns in your database. |
Delete Statement | DELETE FROM table_name [WHERE Clause] | Deletes specific data from specific columns in your database. |
Mysqli Prepared Statements | ||
Selecting variables | $stmt = $mysqli->prepare("INSERT INTO myTable (name, age) | Here we use the prepare statement then select the table and field names. |
Bind variables to values | VALUES (?, ?)"); $stmt->bind_param("si", $_POST['name'], $_POST['age']); $stmt->execute(); $stmt->close(); | the (?) are substitutes for values. bind_param binds the parameters to the SQL query and the 'sss' represent the data type: usually (s)string or (i)integer.Then post your variable names and execute. |
Xammp -- The Server and its contents | ||
Xammp contains a server, php , mysql & PhpMyAdmin. | PhpMyAdmin: Powerful Free Mysql Editor | It can show you structure & data in tables.
MyPhpadmin can also create users and modify priviledges.
Filtering Data
|
use between, && [and] other operators to filter data | Sometimes its necessary to narrow query results using: greater than, less than, or equal to, limit, betweeen or AND to recieve better data results | After you filter the data you use php loops and a table to make the data readable. |