Jump to content


Photo

i want this..result


  • Please log in to reply
8 replies to this topic

#1 sun14php

sun14php
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 22 June 2006 - 11:29 AM

working on mysql with php, as my data is displayed in browser in the tabular form as below
id name class result
1 sun five

i 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


#2 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 22 June 2006 - 12:14 PM

[!--quoteo(post=386801:date=Jun 22 2006, 07:29 AM:name=sun14php)--][div class=\'quotetop\']QUOTE(sun14php @ Jun 22 2006, 07:29 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
working on mysql with php, as my data is displayed in browser in the tabular form as below
id name class result
1 sun five

i 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>";
If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#3 sun14php

sun14php
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 22 June 2006 - 12:54 PM

jvr,....
please clear........ does i put ID manually in hyperlink command ? if so i do'nt like that solution. understand my problem first

#4 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 23 June 2006 - 12:06 PM

echo "<TD><a href=update.php?"ID=".$id." target='_blank'>".$id."</a></TD>";

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.......

If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#5 sun14php

sun14php
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 30 June 2006 - 05:57 AM

hi,

  i could not get u please clarify more..

how do i access cell(hyperlink value ) into next php script

#6 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 30 June 2006 - 12:21 PM

         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);
         }

If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#7 sun14php

sun14php
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 01 July 2006 - 05:01 AM

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        result
1              12              67
2              11              67

now 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 ?

#8 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 01 July 2006 - 05:12 AM

sorry no not clair

is the uodate working?

if so redirect user to there main page to see results?

redirect code from update

header("location: what ever page.php?&id=$id");


what ever page.php

view 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.     
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#9 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 01 July 2006 - 05:36 AM

here is an example:

page1.php
<?php
   echo "<a href='page2.php?id=2'>two</a>";
?>

page2.php
<?php
   if ($_GET['id']) {
      $id = $_GET['id'];
      $sql = "update tablename set blah = 'blah' where id = '$id'";
      mysql_query($sql);
   }
?>
 


Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users