sayedsohail Posted March 15, 2007 Share Posted March 15, 2007 Hi everone, I just wanted to refresh only part of the page, i.e., table2 on my php page. here is my javascript code which performs the refresh it works fine and my php file display all the records. the only problem is: I have got two tables on the same page and i only want to refresh the second table when i click the a row of my first table rows. $query = "SELECT id, name, address_1, p_code, city, l_line, mobile FROM clients WHERE member_id="1" order by name LIMIT $offset, $rowsPerPage"; <table1> while { echo "<tr onclick=\"javascript:void(location.href='{$self}?cid=$id')\">"; <td> .... </td> </tr> } </table> if(isset($_GET['cid'])) { $pid=$_GET['cid']; $query2 = "SELECT id, name, address_1, p_code, city, l_line, mobile FROM sites WHERE client_id='$pid' order by name LIMIT $offset2, $rowsPerPage2"; <table2> while { <tr><td> .... </td> </tr> } </table> } please help. Link to comment https://forums.phpfreaks.com/topic/42867-multiple-navigation-tables-on-one-page-master-slave/ Share on other sites More sharing options...
legohead6 Posted March 15, 2007 Share Posted March 15, 2007 i dont understand what you are doing, and were going to need alot more code then that, also if its javascript problem your going to need to post it in the javascript section of this forum or in another forum, this is a php forum. Link to comment https://forums.phpfreaks.com/topic/42867-multiple-navigation-tables-on-one-page-master-slave/#findComment-208170 Share on other sites More sharing options...
legohead6 Posted March 15, 2007 Share Posted March 15, 2007 have a varable GET command in there, use it to find out if the page needs to load the second table... Link to comment https://forums.phpfreaks.com/topic/42867-multiple-navigation-tables-on-one-page-master-slave/#findComment-208173 Share on other sites More sharing options...
per1os Posted March 15, 2007 Share Posted March 15, 2007 You may even want to look into AJAX. That seems exactly what you need here. Something that can return information from the serve without having to reload the whole page. Ajax is a wonderful and miraculous invention. Link to comment https://forums.phpfreaks.com/topic/42867-multiple-navigation-tables-on-one-page-master-slave/#findComment-208180 Share on other sites More sharing options...
sayedsohail Posted March 15, 2007 Author Share Posted March 15, 2007 I don't mine reloading the whole page, but i don't want to loose the current position on my my first table row. Link to comment https://forums.phpfreaks.com/topic/42867-multiple-navigation-tables-on-one-page-master-slave/#findComment-208185 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.