ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์ProgrammingezSQL ของขวัญจากสวรรค์สำหรับชาว PHP*
หน้า: 1 [2]  ทั้งหมด   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: ezSQL ของขวัญจากสวรรค์สำหรับชาว PHP*  (อ่าน 8169 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
lowprofile
คนรักเสียว
*

พลังน้ำใจ: 11
ออฟไลน์ ออฟไลน์

กระทู้: 189



ดูรายละเอียด
« ตอบ #20 เมื่อ: 05 กันยายน 2007, 16:55:19 »

อืม ขอบคุณคุณโจ้ อยากได้แบบ connect xml แล้วทำงานเหมือน DB เลยอ่ะ 555

หมายถึง XQuery หรือเปล่าครับ? ลองดูตัวนี้นะครับ
http://phpxmlclasses.sourceforge.net/xquery_lite.html

Now we are going to show how some W3C Xquery Use-Cases can be solved using Xquery Lite
In the examples we will work with the "bib.xml" document which has information about books:
อ้างถึง
<bib>
    <book year="1994">
        <title>TCP/IP Illustrated</title>
        <author><last>Stevens</last><first>W.</first></author>
        <publisher>Addison-Wesley</publisher>
        <price> 65.95</price>
    </book>

    <book year="1992">
        <title>Advanced XML Programming in the Unix environment</title>
        <author><last>Stevens</last><first>W.</first></author>
        <publisher>Addison-Wesley</publisher>
        <price>65.95</price>
    </book>

    <book year="2000">
        <title>Data on the Web</title>
        <author><last>Abiteboul</last><first>Serge</first></author>
        <author><last>Buneman</last><first>Peter</first></author>
        <author><last>Suciu</last><first>Dan</first></author>
        <publisher>Morgan Kaufmann Publishers</publisher>
        <price> 39.95</price>
    </book>

    <book year="1999">
        <title>The Economics of Technology and Content for Digital TV</title>
        <editor>
               <last>Gerbarg</last><first>Darcy</first>
                <affiliation>CITI</affiliation>
        </editor>
            <publisher>Kluwer Academic Publishers</publisher>
        <price>129.95</price>
    </book>

</bib>

Use-Case 1
อ้างถึง
<bib>
 {
  for $b in document("c:\apache\htdocs\phpxmlclasses\bib.xml")/bib/book
  where $b/publisher = "Addison-Wesley" and $b/@year > 1991
  return
    <book year="{ $b/@year }">
     { $b/title }
    </book>
 }
</bib>

Comment: we retrieve all book elements using a for statement and filter by the name of the published and the year attribute (note the element/@name notation). The return just builds an XML document listing the year as an attribute and the title of the books that match the criteria.

The result will be something like this:

อ้างถึง
<bib>
<book year="1994">
<title>TCP/IP Illustrated</title>
</book>
<book year="1992">
<title>Advanced XML Programming in the Unix environment</title>
</book>
</bib>


อันนี้เหมาะกับการจัดการ xml --> xml นะครับ ถ้าต้องการ xml --> data คงต้องทำตามที่คุณ EThaiZone แนะนำครับผม
บันทึกการเข้า

ชีวิตนี้น้อยนัก

๏ พายเถิดพ่ออย่ารั้ง   รอพาย
จวนตะวันจักสาย   ส่องฟ้า
ของสดสิ่งควรขาย   จักขาด ค่าแฮ
ตลาดเลิกแล้วอ้า   บ่นอื้นเอาใคร ๚ะ๛


คราวนี้เป็นคราวเงินหมด
ธนาคาร : ไทยพาณิชย์ จำกัด (มหาชน) สาขา : อุดรธานี
ชื่อบัญชี : โครงการช่วยชาติโดยหลวงตามหาบัว ญาณสัมปันโน
เลขที่บัญชี : 510-2-83957-5
hunter
ก๊วนเสียว
*

พลังน้ำใจ: 2
ออฟไลน์ ออฟไลน์

กระทู้: 393



ดูรายละเอียด
« ตอบ #21 เมื่อ: 05 กันยายน 2007, 16:57:37 »

ขอบคุณครับ คุณ Low  Angry
บันทึกการเข้า

ทำการใหญ่ ใจต้องนิ่ง
7
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 16
ออฟไลน์ ออฟไลน์

กระทู้: 1,349



ดูรายละเอียด เว็บไซต์
« ตอบ #22 เมื่อ: 05 กันยายน 2007, 18:33:10 »

โอ้ว สุดยอดเลย ขอบคุณทั้ง 2 มากๆ
บันทึกการเข้า

gootooyoo
ก๊วนเสียว
*

พลังน้ำใจ: 27
ออฟไลน์ ออฟไลน์

กระทู้: 464



ดูรายละเอียด เว็บไซต์
« ตอบ #23 เมื่อ: 24 กันยายน 2010, 18:34:10 »

 :wanwan004:เมื่อก่อนเคยเขียน class เองบ้างครับ แต่เริ่ม php เริ่มหลายverstion และต้องทำงาน อื่นอีกเลย ไม่ค่อยได้เขียน หัดใช้ของฟรีบ้างก็ดีครับชอบคุณ wanwan016
บันทึกการเข้า

ขวากหนาม ที่เราต้องข้ามผ่าน ถึงจะเจ็บก็จะไป (\◣_◢/) 
❤ 
ohmohm
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 170
ออฟไลน์ ออฟไลน์

กระทู้: 3,092



ดูรายละเอียด เว็บไซต์
« ตอบ #24 เมื่อ: 24 กันยายน 2010, 23:30:39 »

ไหนๆ ก็ขุดแล้ว แล้วไปเจอมาพอดี พัฒนาโปรแกรมง่ายๆ ไร้ SQL ด้วยเทคนิค O/R mapping ( Java นะ ไม่รู้ php มีไหม )
http://www.narisa.com/forums/i...p;blogid=30&showentry=2334
บันทึกการเข้า
หน้า: 1 [2]  ทั้งหมด   ขึ้นบน
พิมพ์