get id url display help, how to call multiple get url id
I want to know how to move forward on this. How does someone produce this result using PHP and MySQL. Original link is samplesite.com/welecome.php A user then clicks on a link within the page, that link becomes samplesite.com/welecome.php?hi=54&mov=777.
I know how to produce th开发者_StackOverflow社区e get url id which in this cass is ?hi=54, how can i accomplish &mov=77 when someone clicks a link within the page. i am using php and mysql. from one table the contents for id 77 shows up, how can i get the contents for the mov table for id 77 to show up also on the same page.
Im presume that you are using PDO extension for database connection, so your code could look like this:
$request = filter_input_array(INPUT_GET, array(
'hi'=> FILTER_VALIDATE_INT,
'mov'=> FILTER_VALIDATE_INT
));
$sth = $dbh->prepare("SELECT * FROM movies WHERE movie_id=?",$request['mov']);
$sth->execute();
$movie = $sth->fetch();
精彩评论