sun14php Posted June 22, 2006 Share Posted June 22, 2006 working on mysql with php, as my data is displayed in browser in the tabular form as belowid name class result1 sun fivei want as i click (making id filed hyperlink) on particular id it automatically take me to update form an & i can update "result" filed thr after that. it also display the clicked id value in a text box. how i code it ?regards Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/ Share on other sites More sharing options...
jvrothjr Posted June 22, 2006 Share Posted June 22, 2006 [!--quoteo(post=386801:date=Jun 22 2006, 07:29 AM:name=sun14php)--][div class=\'quotetop\']QUOTE(sun14php @ Jun 22 2006, 07:29 AM) [snapback]386801[/snapback][/div][div class=\'quotemain\'][!--quotec--]working on mysql with php, as my data is displayed in browser in the tabular form as belowid name class result1 sun fivei want as i click (making id filed hyperlink) on particular id it automatically take me to update form an & i can update "result" filed thr after that. it also display the clicked id value in a text box. how i code it ?regards[/quote]echo "<TD><a href=update.php?ID=1 target='_blank'>1</a></TD>"; Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-48437 Share on other sites More sharing options...
sun14php Posted June 22, 2006 Author Share Posted June 22, 2006 jvr,....please clear........ does i put ID manually in hyperlink command ? if so i do'nt like that solution. understand my problem first Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-48443 Share on other sites More sharing options...
jvrothjr Posted June 23, 2006 Share Posted June 23, 2006 [code]echo "<TD><a href=update.php?"ID=".$id." target='_blank'>".$id."</a></TD>";[/code]use a variable to place the value if the correct places in the line $id being the value you wish to pass to the update page....... Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-48754 Share on other sites More sharing options...
sun14php Posted June 30, 2006 Author Share Posted June 30, 2006 hi, i could not get u please clarify more..how do i access cell(hyperlink value ) into next php script Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51053 Share on other sites More sharing options...
jvrothjr Posted June 30, 2006 Share Posted June 30, 2006 [code] mysql_select_db ("menu"); $result = mysql_query ("select * from linktable"); if ($row=mysql_fetch_array($result)) {//This is one way pull the whole string from a field echo "<a href = '/".$row['Link']."' TARGET='main'></p>";//This is a second way by just adding the value to the Fixed URL echo "<a href = 'EditPage.php?id=".$id."' TARGET='main'></p>"; $row=mysql_fetch_array($result); }[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51173 Share on other sites More sharing options...
sun14php Posted July 1, 2006 Author Share Posted July 1, 2006 jvrothjr, u tried the best , but i could not understatnd ru code. let me explain u.A table showing records in browser as below(show.php):ID class marks result1 12 672 11 67now since i encapuslated id filed(cell) into hyperlink to take me to update.php page from show.php. At ths point if i click on id's fileds value assume on 1 it will take me to the update.php page ,here i want it display the id filed's value(which clicked in show.php page)on update.php, in our case, it's 1. Is it clear ? Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51522 Share on other sites More sharing options...
redarrow Posted July 1, 2006 Share Posted July 1, 2006 sorry no not clairis the uodate working?if so redirect user to there main page to see results?redirect code from updateheader("location: what ever page.php?&id=$id");what ever page.phpview user results<?mysql_select_db ("menu");$query = "select * from linktable where id=$id";$result=mysql_query($query);while(list($key,$value)=each($result) {echo"<br> $key : $value <br> ";}?> An idear hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51525 Share on other sites More sharing options...
.josh Posted July 1, 2006 Share Posted July 1, 2006 here is an example:page1.php[code=php:0]<?php echo "<a href='page2.php?id=2'>two</a>";?>[/code]page2.php[code=php:0]<?php if ($_GET['id']) { $id = $_GET['id']; $sql = "update tablename set blah = 'blah' where id = '$id'"; mysql_query($sql); }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51530 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.