PhpMysql $_post $_get

Hello Experts...I really need your help Im having problem with my code
( How can I echo the $row["id"];)
to other php?...

I have a query on the second page

$query = "SELECT * FROM tbl_route WHERE fk_travel_id = '".$_GET["id"]."'";

Now what I want to happen is go get the row ID value of my table and add it into my query

                               while($row = mysqli_fetch_array($result))  
                               <tr class='clickable-row' data-href='route.php?route=<?php echo $row["id"];?>' id="<?php echo $row["id"];?>">
                                    <td><input type="checkbox" name="travel_id[]" class="delete_id" value="<?php echo $row["id"]; ?>" /></td>
                              <td><?php echo $row["destination"]; ?></td>  
                              <td><?php echo $row["description"]; ?></td>  
                              <td><?php echo $row["dater"]; ?></td>  
                              <td><input type="button" name="edit" value="Edit" id="<?php echo $row["id"]; ?>" class="btn btn-info btn-xs edit_data" /></td>  
                                    <td><input type="button" name="view" value="view" id="<?php echo $row["id"]; ?>" class="btn btn-info btn-xs view_data" /></td>  

How to solve this guys?...or any other to execute in same way...

Thank You in Advance Experts
Yaku KakashiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leonidas DosasCommented:
If i understand correctly you must use $_SESSION global variable. Check this tutorial link
mohan singhWeb developerCommented:
Hi @Yaku Kakashi
Always put your code in code section Ok

//this is your query write
$query = "SELECT * FROM tbl_route WHERE fk_travel_id = '".$_GET["id"]."'"; 

//change your query like this
$id =$_GET['id'];
$query = "SELECT * FROM tbl_route WHERE fk_travel_id = '$id' "; 

if pass id from One page to Another page then you have to request that id 
//please put your code inside of code box

Open in new window

Yaku KakashiAuthor Commented:
Yes I already corrected my code Experts...thank you... Well Done..
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

mohan singhWeb developerCommented:
Your problem is solved or not
if it solved so please close the question

Thank you

Mohan SIngh
Julian HansenCommented:
It is not clear what you are trying to do.

What do you mean when you say
How can I echo the $row["id"]
Where does $row['id'] come from
How / why do you need it in a second PHP page?
Is the second PHP page part of the same request or are you describing a situation where the id must persist over multiple requests from the client?
Chris StanyonWebDevCommented:
If you look at your PHP code:

<tr class='clickable-row' data-href='route.php?route=<?php echo $row["id"];?>

Your route.php now has a query string with a parameter name of route, so in order to use that in route.php, you would need $_GET['route']

$query = "SELECT * FROM tbl_route WHERE fk_travel_id = '".$_GET["route"]."'";

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Yaku KakashiAuthor Commented:
Thank you guys... You are really awesome
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.