2 like 0 dislike
3.1k views
There is a table named `books` with five field which are `serial` `book_name` `author` `price` and `publisher` and another table named `comment` with two field which are `serial` and `content`. The `comment`.`serial` is connect to the `books`.`serial`. Please write a php script to list all books and its comment count.
[Exercise] Essay (Open question) - asked in 2016-2 CSIEB0270 - Internet System Design and Practice by (18k points)
ID: 24996 - Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00

reshown by | 3.1k views
0 0
Called for Help

11 Answers

0 like 0 dislike
Hidden content!
* * * ** html>
* ** **
**** * ** **
** ** *** * ** * ** * * * * ** ******** * ** **
*** ****** * ** * * **** ***** ***** * * * * *** *** *** ** />
**** * ***** *
* * * *
** ** *** ** * * * * * *** **** *
** * *** **** * * **** ** ** *** *** * * **** * ** * * ** />
** * ***
*** ** ***
*** * * * * ** ** ** * * *
** * * ***** * * * ** ** ** **** ** **** ** *** />
**** **
* *** **
* ** ** *** ***** ***** ** **** * *
** ** *** * * * *** ** ** ** ** * * * ** **** * ** **** * * ** ***** *
*** **
* * * **
* ** * * * **** ** * * ****** ** />
* *** ** ** * * ** * *** ** ** />
* *** ****
** ** *
*
**** ***
* * ** ***
if * * * *
** *** * *** *** ** *
exit();
}
?>

* *
if **** * **
echo *** **** * * ***** ** * ** * * ** *
}else{
* *** * ** * * ** * * ?>
* * * ** *****
* * *
* ****** * *** ** ** echo ** * * * ?>'s * ***** ** **

* * * **** * * ** ** ** * **** * ** * ** * * * ** **** *
** * ***
** * ****
* * * ** * * * **
* **** echo * * **** * ** ?>

<a * *** * * * ** * * * * ** *
** **
<div **** * * * **
*** * * include 'nav.php' ?>
**** *
*** *** *
* *** * **** *
answered by (-233 points)
0 like 0 dislike
Hidden content!
* ** * ** * ** * * * * * * *****
answered by (-32 points)
0 like 0 dislike
Hidden content!
* * * * *** *** ** * ** ***
answered by (-61 points)
0 like 0 dislike
Hidden content!
****
*** = * ****** * * **** * ** FROM ** *****
** = * * * ***


* ($row = * * *** {
** * * = **** *
***** *** *** * **** * * as ** ** {
****** = *** ** . ** *** * . * ** ** . **** . * * **

}


* * * = * ** * INTO ** ** * * * *** ** ***
* .= ', * **


*** ** * * *

}
**
answered by (157 points)
0 like 0 dislike
Hidden content!
<!DOCTYPE html>

<html>

    <head>
** * *** * *** ******* ** * ** ** * * ***** *** 3</title>

        

    </head>

    <body>

        <?php
*** ******* ** ****** * * * ** *** **** ** *** * ** ** * ** *** * *
** * ** * ***** ** * ** * * ** * * * ****** * *** **** *** **** * **
* * * * * **** * ** * * * **** * * * * *** *** * **** ** *** *
* * * ** * ** * * **** * * * **** * ** * * * * * ** * * *** *

        
* ** * * *** ** *** * *** * ** * * * * * ** * ** ** * = @mysqli_connect($host,$username,$password,$db);
*** *** * * * *** * **** ** * * *** *** *** * *** *** ** * **** (!$try1)
*** ** *** *** * * ** ** ** ** ** * * * *** ** ** * * ** ** *
* * *** ***** *** ****** ** ** * * * * * *** * ***** *** ** ** *** **** ** * ** ** not connect: '.mysqli_error($try1));
** * ** ** ***** ***** * **** **** * * * ** * **** ***** ***
* * **** * * **** **** ****** * * * *** ****** ** * * *** mysqli_select_db($con,"students");
* *** ** * *** * * * ** *** * ** ** * * ** *** ******* * * * *** ** * ******* books.serial, books.book_name, books.author, books.price ,COUNT(coment.comment) AS COMMENTS FROM coment

LEFT JOIN books on coment.Serial=books.serial

GROUP BY serial";
** **** * ** * *** * ** ** * * * * * ** * ** * * * * ***** *** * ** * * **

        
* * *** * ** **** * * ** * * *** ** * **** * * * ********* * "<table>
**** *** *** ** * ********* ** * * * * ** **** **** ** ******** **** ** *** **** * *** *
* *** ** * *** ** *** * * ** * * * ** ** * ** ** * *** * * ********* ** *** * **** * * **** * ** * ****
** *** *** ***** * * * * * * * * * * * * ** *** *** **** * * ***** *** ** ** * * ** * **** * * ** * Name</th>
* * * * ** * * *** * *** * ** ** ** * **** ** * * * * *** ** **** *** ****** * ** ** **** **
* * * *** ** * ***** ****** * ** * * ** ** **** **** * * *** *** * *** *** *** * ** * *** ***
* ******* ** * ***** * * ** ***** * * * ** ****** * ***** ** ***** ** *** ***** * * * ** ** * *** * ** *
* ** * * * * * ** * ***** *** ** ** *** * *** **** ** *** *** * ******* * ** ** * *** * ** *** *
** * *** **** * * **** ***** *** **** *** * ** ** * **** * ** ** *** (!$result)
* * ** ***** * ******* ** ** ** ** * * ***** * *** ** ** ** ** * * ***
** *** ** * * * * ** *** *** * *** * *** * ** **** * ** *** ** ** * "Error: ".mysqli_error($con);
** ****** ** * ** * ***** * ****** ** ** ** ***** * * * ** **** * * * *** * ** ****
* ***** ** * * * * *** **** * * *** ** ** * * * *** ** * * **
** * **** * ***** *** * * * * ** * * * **** * * ** *** * * *** ** * ** ($row=mysqli_fetch_array($result))
* *** * ** * * *** *** ** * * * ** * *** ***** ** * *** *****
* * ** * ** * ***** **** * ********** ** * * *** * ** *** ** * * * * **** * * *** "<tr>";
* * *** * ** * ****** * * ** ** * ** * ** ** * * ** * **** * * * * * ** *** * ********** * * * ** ** *** *** * ** * ** ***** ** * * * * **
** ** *** ** * **** * * * * **** * * * ***** * * *** * *** * * * * * *** * * * * * ** *** *** * * *** * **** ******** ** ***** ** * ** *** *** *
* * ** * ** ** * ** * * *** ** * * **** * * **** **** * ** * * **** * ** * *** ***** ** ** *** * *** ** * *** * *** **** * ** ***** ** ** * *** ****
* * ** *** *** *** * * ** * * * * ***** ** ** * ** * * * * *** ** * * * * * * * "<td>".$row['price']."</td>";
** *** ** * ** * * * **** * ** *** * ** *** * * * *** * * * * ** ** *** ** ** ** ** ***** * **** * *** * * * ** * * *** **
* * * * * * * **** *** * *** * ** *** ** * * * ***** **** * ** * ** * * **** *** "</tr>";
** * * ** ******* * * **** ** *** *** ** * * ** * * ** ** * ** **** *
**** * * * * * * ** * ** *** * * * ** **** * **** ** * *** ** ** *** "</table>";
** ***** **** * ** * ** *** *** ** * * ** **** * ** * * * *** * * **** ($con);

    </body>



</html>
answered by (30 points)
0 like 0 dislike
Hidden content!
<!DOCTYPE html>

<html>

    <head>
* *** * **** ** ** *** ** * * *** * * ** * ** ** * ***** #3</title>

        

    </head>

    <body>

        <?php
*** ***** * *** *** ** * * ** ** * * **** ** ***** * * * **** *****
* * ** ******* ** * **** * ** * ** * * ** *** **** ** ** ** **** *** **
** * * * **** * * *** * * * ** * ** *** * ** ** * * *
** ** ** * * * ** ** * ** ** * * ** * * * * * * ** * * * *** ***

        
**** ***** * * ** * * * **** * *** *** ** ** * * ** * * * ***** *** * * * = @mysqli_connect($host,$username,$password,$db);
**** ** ** * ******** * * ** ** **** *** * ** * * * * (!$con)
* * * **** * * * ** ***** * *** ** **** ** * * * ******* **
* ** ** ***** * **** * ** ** ** * * **** **** * *** * ******** * * ** * * * * ** ** * not connect: '.mysqli_error($con));
** * * ** * * * **** ** * *** * **** * ***** ***** ** * **
* **** * **** **** * ****** * ** ** ***** * *** ******* ** * * ** * ******* books.serial, books.book_name, books.author, books.price ,COUNT(coment.comment) AS COMMENTS FROM coment

LEFT JOIN books on coment.Serial=books.serial

GROUP BY serial";
* * * *** * * * *** * ** * * *** * * * *** * ******* * * ***** * * * * * * ** ***

        
*** * * * * ** ** * * * ** * * * ***** *** ** ***** ** * *** ** *** "<table>
* ** * * * * ** ** **** ***** * * * ** * * * ** *** **** *** ** ** *** ***** * * *** *
** ** * * * ** ** * *** * ***** * * * * *** ** **** * ** *** **** * * * * * * * *** **** *** ** * * *
*** *** * * *** * * * *** * *** **** **** ** * ** * *** ** * * * * * ** * **** ****** * *** *** Name</th>
* *** * * *** * ** * ** **** *** * * *** * ** * ** ** ** *** ***** * * * ******* ** * * * * **
* * *** * *** ** ** * *** ** * * ** ** ** ** ******* * ** *** *** * * *** * *** ******* ** * ****** ** * * *
* **** * *** *** ** * ** ** *** ** * * * * **** * ** * ** ** **** * * *** *** ** ** * * ** * * * *** *
** ** *** * ** * * ***** *** * ** ** *** *** * ** * * *** * **** * * ** * *** * * ** ***** * *******
*** ** *** ** * ** ** * **** **** ** ** * ***** * *** * ** (!$result)
** ** ** * ** * * * ** ***** * * ** ** * ** * * * *****
* * **** * ** *** ***** ** ** ** * *** * *** * ***** *** **** * * *** * **** * ***** "Error: ".mysqli_error($con);
*** **** ** ** **** ****** ** *** ** ***** **** * *** ** * * * *** *** **** * ** *
* **** ** ** * * *** * ** * * * ** **** *** *** ** ***** * *** ** **** *
* * * **** * ***** * ** * * * ******** * * * *** * * * ** ($row=mysqli_fetch_array($result))
** ***** ** *** * * * ** **** * *** * * *** ****** ** ** ** ** * ** **** * *
**** ** * **** ** ** * ** ** ***** * * * * * * * * * * * ** ** ** * ** * **** ***** ** * "<tr>";
* * * ** *** * ** *** * ** * ***** * * **** *** * * ** ** * * ** * * ** ***** * * *** * * ** * * * ** * * ****
* **** ** * ****** *** * ** * * *** ** * **** ** * *** * * ** ******* ****** ** ** * ** ****** ** * * * ** ** * ** * ** * ** ****** ***
** *** *** ** **** ** ** * * * ** * *** *** * * * ** **** * * ** * * * * ** * * *** **** * * *** * *** ** ** * * * *** **** * *** **** * *
****** *** **** ** * ** * *** ** * * *** **** * * * * ** * * *** * **** **** ** "<td>".$row['price']."</td>";
** *** ** ** * * * * * * ** * ** *** * *** ****** * * * * * * ** * * *** * * * ** * ** * *** ***** * *** **** * * * **
** *** * * **** *** * ** * *** * *** ** *** ** * * ***** * * * **** * ** * * * * * * * "</tr>";
*** * * ** * *** *** * ** *** ** ***** * *** * *** ** **** * ** ** **
* * * * * * ** * *** **** *** * *** * ** * ** ******** *** * "</table>";
** * ****** * ** ** * **** ** * * * * * * * ** * ***** * * ** ($con);

    </body>



</html>
answered by (-168 points)
0 like 0 dislike
Hidden content!
* ** *** ***** ** *** * **** *** * ** *
answered by (-335 points)
0 like 0 dislike
Hidden content!
* ** ******* * *** ** * *** * * ** * **
answered by (-144 points)
0 like 0 dislike
Hidden content!
**** ** ** ** **** * *** ** ** * * **
answered by (16 points)
0 like 0 dislike
Hidden content!
* *
* ** = **** * * * ** **** * ** * **
* = * * **** ***
* * = ** * ** ** {
*** = *
* * * ** ** as * * *** {
** * = ***** . *** ***** ** . ** ** . * ** * . *** ***
}

* * = * * * * *** *** * * * *** **** ****** * **
** *** * * *** *

**** * **
}
****
answered by (-434 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:104.23.243.108
©2016-2026

Related questions

1 like 0 dislike
14 answers
[Exercise] Essay (Open question) - asked Jun 15, 2017 in 2016-2 CSIEB0270 - Internet System Design and Practice by Shun-Po (18k points)
ID: 24998 - Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 3.3k views
3 like 0 dislike
23 answers
[Exercise] Essay (Open question) - asked Jun 15, 2017 in 2016-2 CSIEB0270 - Internet System Design and Practice by Shun-Po (18k points)
ID: 24997 - Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 4.2k views
3 like 0 dislike
20 answers
[Exercise] Essay (Open question) - asked Jun 15, 2017 in 2016-2 CSIEB0270 - Internet System Design and Practice by Shun-Po (18k points)
ID: 24995 - Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 3.4k views
3 like 0 dislike
23 answers
[Exercise] Essay (Open question) - asked Jun 15, 2017 in 2016-2 CSIEB0270 - Internet System Design and Practice by Shun-Po (18k points)
ID: 24994 - Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 4.2k views
2 like 0 dislike
24 answers
[Exercise] Essay (Open question) - asked May 17, 2017 in 2016-2 CSIEB0270 - Internet System Design and Practice by Shun-Po (18k points)
ID: 24646 - Available when: 2017-05-18 09:30:00 - Due to: 2017-05-18 12:00:00
| 3.9k views
12,783 questions
183,442 answers
172,219 comments
4,824 users