Use the query:

echo "&lt;table&gt;\n";
echo "&lt;tr&gt;&lt;th&gt;Store ID&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Avg. Rating&lt;/th&gt;&lt;/tr&gt;\n";
$result = mysql_query("SELECT s.store_id, s.store_name, AVG(r.rating) AS avg_rating
                       FROM stores as s
                       JOIN ratings as r ON s.store_id = r.store_id
                       GROUP BY s.store_id");
while ($row = mysql_fetch_assoc($result)) {
    echo "&lt;tr&gt;&lt;td&gt;$row[store_id]&lt;/td&gt;&lt;td&gt;$row[store_name]&lt;/td&gt;&lt;td&gt;$row[avg_rating]&lt;/td&gt;&lt;/tr&gt;\n";
}
echo "&lt;/table&gt;\n";


Then loop through the results of this query. Each row will be the average rating of a different store.

PHP - how to output a MySQL average store rating in a loop
Can someone help me how to read pptx file in java?i would prefer if this can be read with apache POI, i have been searched this tutorial but i can't find it.I've been successfully read the ppt file with this code :

try {
    FileInputStream fis = new FileInputStream(file);
    fs = new POIFSFileSystem(fis);
    HSLFSlideShow show = new HSLFSlideShow(fs);
    SlideShow ss = new SlideShow(show);
    Slide[] slides=ss.getSlides();
    for (int x = 0; x &lt; slides.length; x++) {
        System.out.println("Slide = " + (x + 1) + " :" + slides[x].getTitle());

        TextRun[] runs = slides[x].getTextRuns();
        for (int i = 0; i &lt; runs.length; i++) {
            TextRun run = runs[i];
            if (run.getRunType() == TextHeaderAtom.TITLE_TYPE) {
                System.out.println("Slide title " + (i + 1) + ": " + run.getText());
            } else {
                System.out.println("Slide text run " + (i + 1) + ": "  + run.getRunType() + " : " + run.getText());
            }
        }
    }
} catch (IOException ioe) {
    ioe.printStackTrace();
}


Can someone tell me what part of this code must be modified to read pptx file?
