adding a link to id field

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jd57
Forum Newbie
Posts: 13
Joined: Tue Apr 21, 2009 8:04 am

adding a link to id field

Post 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>';
uxan
Forum Newbie
Posts: 3
Joined: Mon Jul 13, 2009 11:07 am

Re: adding a link to id field

Post 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>
Post Reply