2 like 0 dislike
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)
Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00

reshown by | 160 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)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.79.171
©2016-2021

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)
Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 161 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)
Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 196 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)
Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 141 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)
Available when: 2017-06-15 09:30:00 - Due to: 2017-06-15 12:00:00
| 185 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)
Available when: 2017-05-18 09:30:00 - Due to: 2017-05-18 12:00:00
| 160 views
11,163 questions
132,617 answers
129,948 comments
3,821 users