WordPress Database Diagram สำหรับ WordPress 3.4

Database Description

WordPress เวอร์ชั่นนี้สนับสนุน MySQL เวอร์ชั่น 5.0.15 ขึ้นไป

Database Diagram

WordPress Database Diagram 3.4

Full resolution‎ (1,079 × 1,089 pixels, file size: 204 KB, MIME type: image/png)

Please note that within the standard installation of WordPress no integrity between the tables is enforced e.g. between posts and comments. If you are creating a plugin or extension that manipulates the WordPress database, your code should do the housekeeping so that no orphan records remain in the tables e.g. by removing records in other tables with a set of SQL commands when foreign keys are deleted (Don’t forget to remind users to backup before such operations).

Warning: ดาต้าเบส ไม่มีการกำหนด integrity

Example: เขียน query แสดง id และ หัวข้อเรื่อง ของเรื่องทั้งหมดที่จัดอยู่ใน category ที่ 5

[code language=”sql”]

SELECT id, post_title
FROM wp_posts
INNER JOIN wp_term_relationships
on wp_posts.id=wp_term_relationships.object_id
WHERE wp_term_relationships.term_taxonomy_id=5
ORDER BY wp_posts.id desc;

[/code]

Java: Command Line Arguments

การใส่อาร์กิวเมนต์ทาง command line

Source code

[code language=”java”]
public class HelloJava {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 0; i < args.length; i++) {
System.out.println(args[i]);
}
}
}
[/code]

Run

ใส่ zero one two three ต่อท้ายคำสั่ง ดังนี้

$ java HelloJava zero one two three
zero
one
two
three

WordPress Plugin “SyntaxHighlighter Evolved”

SyntaxHighlighter Evolved

http://wordpress.org/extend/plugins/syntaxhighlighter/

เป็น Plugin ที่ช่วยให้การแสดง Source code สวยงามขึ้น

SyntaxHighlighterEvolved

โดย SyntaxHighlighter Evolved พัฒนาต่อมาจาก http://alexgorbatchev.com/SyntaxHighlighter/

การใช้งานเพียงบอกว่า sourcecode หรือ code ที่ใช้เป็นภาษาอะไร เช่น

[code language="css"]
your code here
[/code]

ใช้ language (หรือ lang) ในการกำหนดภาษาโปรแกรมที่ใช้ ภาษาที่ใช้ได้มีดังนี้ [อ้างอิง]

  • actionscript3
  • bash
  • clojure
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • html
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • r
  • ruby
  • scala
  • sql
  • vb
  • xml

ตัวอย่าง

Java

[sourcecode language=”java”]
public class HelloJava {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World!");
}
}
[/sourcecode]

หรือ CSS

[code language=”css”]
#button {
font-weight: bold;
border: 2px solid #fff;
}
[/code]

เริ่มต้นเขียน Java กับ Hello World!

เปิด Eclipse ขึ้นมา

สร้างจาวาโปรเจ็กส์ใหม่ชื่อ HelloJava

  • File -> New -> Java Project
  • Project name: HelloJava

สร้างคลาสชื่อ Hellojava

  • คลิกขวาที่โปรเจ็กส์ HelloJava แล้วเลือก New -> Class
  • Name: Hellojava
  • คลิกเครื่องหมายถูกหน้า public static void main(String[] args)

พิมพ์คำสั่งแสดงผลออกหน้าจอ

[sourcecode language=”java”]
public class HelloJava {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World!");
}
}
[/sourcecode]

การรัน ด้วย Eclipse:

กด Ctrl+F11

การรันด้วย Command line:

$ javac HelloJava.java
$ java HelloJava

HTML Entities

ตัวอักษรบางตัวในภาษา HTML เป็นตัวอักษรสงวน ไม่สามารถเขียนได้โดยตรง
ให้ใช้ HTML Entities แทน ดังนี้
&entity_name; หรือ &#entity_number;

Result Description Entity Name Entity Number
non-breaking space &nbsp; &#160;
< less than &lt; &#60;
> greater than &gt; &#62;
& ampersand &amp; &#38;
¢ cent &cent; &#162;
£ pound &pound; &#163;
¥ yen &yen; &#165;
euro &euro; &#8364;
§ section &sect; &#167;
© copyright &copy; &#169;
® registered trademark &reg; &#174;
trademark &trade; &#8482;

HTML Entities
HTML Entities Reference (HTML ISO-8859-1 Reference)
HTML ASCII Reference
HTML Symbol Entities Reference