Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
308 views
in Technique[技术] by (71.8m points)

mysql - Display data from another php site

I am having trouble to display my bookISBN in another php site. Actually my first php page I have tabulated the data into a table form. And now I want to let the user to click on the book title and open a new php page where it shows the books details.

This is my first php page code:

echo "<table width = "1000px" border = "1" cellpadding = "1" cellspacing="1">";
echo "<tr>";
echo "<th>".'Book ISBN'."</th>";;
echo "<th>".'Book Title'."</th>";
echo "<th>".'Book Year'."</th>";
echo "<th>".'Category ID'."</th>";
echo "<th>".'Category Description'."</th>";
echo "<th>".'Book Price'."</th>";
echo "<tr>";

if($booknum >= 1 ){
echo "<div style='margin: 0 0 10px 0; font-weight: bold;'>$booknum record(s) found!</div>";
while ($row = mysqli_fetch_assoc($bookrs)) {
    echo "<tr>";
    echo "<td><center>" . $row['bookISBN']."</center></td>";
    echo "<td><center><a href="bookdetails.php">" .$row['bookTitle']. "</a></center></td>";
    echo "<td><center>" . $row['bookYear']."</center></td>";
    echo "<td><center>" . $row['catID']."</center></td>";
    echo "<td><center>" . $row['catDesc']."</center></td>";
    echo "<td><center>" . $row['bookPrice']."</center></td>";
    echo "</tr>";
}

Now I want to know how to retrieve the book ISBN number so that i can display in my second php page. I would be glad if someone can help me with it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

echo "<td><center><a href="bookdetails.php?book=".$row['bookISBN']."">" .$row['bookTitle']. "</a></center></td>";

bookdetails.php you can access with $_REQUEST['book']

Refrence site


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...