Thursday 10 October 2013

How to create Database Using Wampserver


1. Install WampServer and run it.
2.Create Database as shown below



3.Then Create Table as Shown 



4.Create column and enter the name and value for that as shown below



PHP json_encode() function is used for encoding JSON in PHP. 

Normally used to get the data from table.




While executing, this will produce following result:



{

    "response": {
        "items": [
            {
                "sno": "1",
                "name1": "The work",
                "image1": "http://192.168.1.40/image/howto.jpg"
            },
            {
                "sno": "2",
                "name1": "delicious",
                "image1": "http://192.168.1.40/image/delicious.jpg"
            },
            {
                "sno": "3",
                "name1": "positive Thinking",
                "image1": "http://192.168.1.40/image/post.jpg"
            },
            {
                "sno": "4",
                "name1": "Step to sucess",
                "image1": "http://192.168.1.40/image/steps.jpg"
            },
            {
                "sno": "5",
                "name1": "Quran",
                "image1": "http://192.168.1.40/image/quran.jpg"
            },
            {
                "sno": "6",
                "name1": "The public domain",
                "image1": "http://192.168.1.40/image/thepublic.jpg"
            }
        ],
        "success": 1
    }
}



2 comments: