Page 1 of 1

adding a link to id field

Posted: Sun Jul 12, 2009 8:13 am
by jd57
Hi Everyone
can somone give me a hand? I would like to add the followig link to the id field http://www.mysite/SEArchive/approve.php?id=10392 The id # is a variable therefore it will change for each data entered.
Thank you

Code: Select all

$imgpath="http://www.mysite/SEArchive/"; 
 
mysql_connect("localhost", "xxxx_xxx", "xxxx") or die(mysql_error()); 
 
mysql_select_db("xxx_xxx") or die(mysql_error()); 
 
$sql = "SELECT * FROM `ihsreg` WHERE approve!='TRUE' ORDER BY `Bloom_Name` ASC"; 
$results = mysql_query($sql); 
$column = 1; 
 
echo "<table>"; 
 
while(($row = mysql_fetch_assoc($results)) !== false) {    
    $bloom=trim(ucwords($row['Bloom_Name'])); 
    $id=trim(ucwords($row['id'])); 
    $path=substr($bloom,0,1)."/"; 
    if ($column == 1) {  
        print "<tr>";  
    } 
     
    echo ' 
        <td> 
<a href="http://mysite/SEArchive/RegPending1.php?search=' . $row['Bloom_Name'] . '"> 
<img src="'.$imgpath.$path.$bloom.'.jpg" width="130" height="130" border="0"> 
            <BR></a>'.$id.' '.$bloom.'</td>';

Re: adding a link to id field

Posted: Mon Jul 13, 2009 11:37 am
by uxan
I think you should declare a variable where you get the id entered and then put it at the end of the link.

ex: $a=$row['id '], a variable to get the id
<a href=" http://www.mysite/SEArchive/approve.php?id=' .$a ' ">.$a</a>