Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/12628-i-want-thisresult/
Share on other sites

[!--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 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>";
Link to comment
https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-48437
Share on other sites

[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]
Link to comment
https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51173
Share on other sites

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 ?
Link to comment
https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51522
Share on other sites

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.     
Link to comment
https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51525
Share on other sites

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] 

Link to comment
https://forums.phpfreaks.com/topic/12628-i-want-thisresult/#findComment-51530
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.