-
Html - Hyperlink
- <a href="webaddress">Text to contain link</a>
- <a href="http://google.com"> google </a>
-
Html - Printing on Screen
- Print $variable
- Print $price;
-
-
MySQL - List All Tables
SHOW Tables;
-
MySQL - Displaying One Table
- To show table MyTable
- SELECT * FROM MyTable;
-
MySQL - Login
mysql -u username -D username -h mysql-server-1-p
-
Primary Keys
- P rimary key is a field which uniquely identifies the record
- Primary keys cannot have the same entry in that column
- Primary keys cannot be null
- Every table must have a primary key
- C_name VARCHAR(10) PRIMARY KEY
-
Foreign Keys
- Link Tables
- Can have a one to one, one to many, many to one and many to many relationships
- FOREIGN KEY(MyColumnName) REFERENCES YourTable(columName);
-
MySQL - Table Creation
- CREATE TABLE MyTable(
- INT(3) OrderNo,
- VARCHAR(10) Food,
- VARCHAR(15) Name PRIMARY KEY
- )ENGINE=INNODB;
-
MySQL - Inserting Data
INSERT INTO MyTable VALUES(100,'bacon','Finlay');
-
MySQL - Selecting Columns
SELECT Food,Name FROM MyTable;
-
MySQL - Select Based on a Value
SELECT * FROM MyTable WHERE Food = 'bacon';
-
MySQL - Ordering Data
SELECT * FROM MyTable ORDER BY OrderNumber;
-
MySQL - Show From Multiple Tables
SELECT * FROM MyTable,YourTable WHERE Name = 'Finlay';
-
MySQL - Creating a View
- You might create a view to
- Let someone use the view in their own queries whilst hiding data they do not have permission to see (e.g. date of birth)
- Simplify complex queries
- CREATE VIEW MyMovie AS SELECT movieName, MocieTimes,cinemaName FROM movieListings;
-
XHTML
- XHTML is extensible hyper text markup language
- Has a Validator used to double check the XHTML
-
MySQL - Counting
- SELECT count(*) FROM table WHERE comparison clause
- SELECT count(*) FROM mySpy WHERE Gender = 'M';
-
XML
- XHTML is a type of markup language
- XHTML requires addition attributes in the <html>
- img is one of theXHTML elements
- XHTML stand for extensible hyper text markup language
- In XHTML all elements are in lower case
-
Elements
- Headings
- <h1></h1> h2,h3 ect
- Paragraph
- <p></p>
- Unordered Lists
- <ul>,<li>
- Ordered Lists
- <ol>,<il>
-
Lists
- Unordered list
- <ul>
- <li>banana</li>
- <li>apple</li>
- <li>pear</li>
- </ul>
- returns banana,apple,pear
- Ordered List
- <ol>
- <li>banana</li>
- <li>apple</li>
- <li>pear</li>
- </ol>
- returns apple,banana, pear
-
XHTML - Image
- <img src ="destination" alt = "image description"/>
- <img src = "images/lol.jpg" alt = "Picture of funny cat"/>
-
XHTML - Image With a Link
- To create an image that when clicks links to another adress we put a image within the hyperlink code
- <a href ="http://lolcats.com"/>
- <img src = "images/lol.jpg" alt = "Picture of funny cat" />
- </a>
-
IA
- IA stands for Information Archutexture
- Consists of users,context and content
-
-
MySQL - Removing A Table
- DROP TABLE MyTable;
- Removes the tables from the list of tables
- When dropping tables, remove the tables that reference other tables
- If you try to drop the table that is referenced then an error occurs
-
HTML vs XHTML
- HTML
- Case doesn't matter
- Some tags don't need to be closed
- Self-closing tags don't exist
- XHTML is more strict
- All tags need to be closed
- Element names are case sensitive and lower-case
- Self-closing tags exist, e.g. <br/>
-
XHTML Syntax
- All attributes must be in inverted commas
- Valid XHTML: <table width=“100%”><img src="icon.png" height="10" width="10" />
-
How do you setup the background-image decleration?
example:Selector{background-image:url('image.png');}
|
|