Help How Database Create in jason file

59 views
Skip to first unread message

Ario Dony Putra

unread,
Apr 23, 2015, 9:21:24 PM4/23/15
to php...@googlegroups.com
Dear Master,

how to create a data base MySQL with output glossary.json,




$sql = "SELECT id, term, description FROM glossary";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo "id: " . $row["id"]. " - Name: " . $row["term"]. " " . $row["description"]. "<br>";



---------------------------------------------  I need output glossary.json  -----------------------------------------------------------------

###  Glossary Data in a JSON File/Object


    [
      {
        "term": "death, !death star",
        "description": "Cessation of all biological functions"
      },
      {
        "term": "genetic, !genetic testing, genes, DNA",
        "description": "relating to genes or heredity: genetic abnormalities."
      },
      {
        "term" : "creature",
        "description" : "A living being, especially an animal"
      },
      {
        "term" : "subdue",
        "description" : "To conquer and subjugate; vanquish"
      },
      {
        "term" : "replenish",
        "description" : "To fill or make complete again; add a new stock or supply to"
      },
      {
        "term" : "whales",
        "description" : "An inlet of the Ross Sea in the Ross Ice Shelf of Antarctica. It has been used as a base for Antarctic expeditions since 1911."
      }
    ]

--------------------------------------------------------------------------------------------------------------



glossarizer-master.7z

Colin O'Dell

unread,
Apr 23, 2015, 10:03:53 PM4/23/15
to php...@googlegroups.com
Good evening Ario,

This list is not for PHP help and support.  I'd recommend you try asking your question in a more-appropriate location like StackOverflow.

Regards,

Colin

---
Colin O'Dell
Reply all
Reply to author
Forward
0 new messages