Yaku Kakashi
asked on
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
<?php
while($row = mysqli_fetch_array($result ))
{
?>
<tbody>
<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>
</tr>
</tbody>
How to solve this guys?...or any other to execute in same way...
Thank You in Advance Experts
( 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
<?php
while($row = mysqli_fetch_array($result
{
?>
<tbody>
<tr class='clickable-row' data-href='route.php?route
<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>
</tr>
</tbody>
How to solve this guys?...or any other to execute in same way...
Thank You in Advance Experts
If i understand correctly you must use $_SESSION global variable. Check this tutorial link
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I already corrected my code Experts...thank you... Well Done..
Your problem is solved or not
if it solved so please close the question
Thank you
Regards
Mohan SIngh
if it solved so please close the question
Thank you
Regards
Mohan SIngh
It is not clear what you are trying to do.
What do you mean when you say
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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you guys... You are really awesome