Comments (2)
Hi @iBringit Thanks for your reply,
Please take a look at this code
// This is the code to get the page number from the URL
if(isset($_GET['page'])){
$page = $_GET['page'];
} else {
$page = 1;
}
if($page == '' || $page == 1){
$page1 = 0;
}else{
$page1 = ($page*10)-10;
}
//This is my code for the search
// and the $query is a _GET from the URL
$multiSearchResults = $tmdb->multiSearch($query);
foreach($multiSearchResults as $mediaType => $searchResults){
foreach($searchResults as $searchResult) {
if($searchResult->getMediaType() === 'movie') {
echo" <div class='gridViewItem'>
<a href='/movies/movie?id=". $searchResult->getID() ."'><img class='backup_picture' id='poster' src='http://image.tmdb.org/t/p/original". $searchResult->getPoster() ."'></a>
<a href='/movies/movie?id=".$searchResult->getID()."'><div class='gridViewInfo'>"
. $searchResult->getTitle() .
"</div></a>
</div>";
}}};
This code only show me the search result for the first page only from the API and I want to make a pagination on my website with each page show the results associated with the page number .
from tmdb_v3-php-api-.
you need to supply an array for foreach statement, instead you are requesting a key value..
try
foreach ($result as $data)
// then fetch the results here
remember $result returns an array you can fetch within the foreach statement as $ data
from tmdb_v3-php-api-.
Related Issues (20)
- No ../tmdb-api.php file included, on this code HOT 1
- Errer Showing HOT 16
- List of film genres HOT 11
- Empty youtube video problem HOT 5
- how to show movie certification HOT 3
- setAPIKey not working
- Trailer in TV Show HOT 3
- Num of episodes in seasons loop HOT 3
- episodes images not working HOT 1
- I cant get the backdrop HOT 1
- getImageURL not working
- Get Production (Aired) Year for TV Show
- How do I get the [character] each actor played in the movie??
- Auto suggest in search
- A missed quote in README.markdown
- imdb tv id get data not working
- this genre data
- Error Handler
- please insert RatedMovies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmdb_v3-php-api-.