0

Greetings friends. Please help me to understand this issue.

1 echo"<tr><td>< a href=\"home.php?num=$num\">$num</a></td><tr> 
   2    echo"<tr><td>$num</td></tr>";

Basically i wanted to have link for variable $num. I couldn't proceed because of following issue. However second command worked fine for me.

issue : first echo returns below mentioned output.

< a href="home.php?num=23434">23434

second echo returns correct output value 23434.
question: Please make necessary changes to get link with first echo command. Thanks

5
Contributors
8
Replies
28
Views
4 Years
Discussion Span
Last Post by shrikanthnk
0

Try
close your first echo with a quote and semi colon

Edited by fobos

0

As fobos mentioned, the first line's syntax needs to be corrected to include a quotation mark and semicolon at the end of that line.

<?php
$num = 23434; 
echo "<table>";
echo "<tr><td><a href=\"home.php?num=$num\">$num</a></td><tr>";
echo "</table>";
?>
0

code mentioned by you works fine. But i couldn't get the desired result for this...

echo"<table width=\"85%\"  align=center  border=1>";
             echo "<tr><td>Settlement Number</td><td>FirstParty</td><td>SecondParty</td><td>Email</td><td>Phone</td><td>Created Date</td></tr>";
             while($row=mysql_fetch_array($sql))
             { $num=$row['num'];
               $firstparty=$row['firstparty'];
               $secondparty=$row['secondparty'];
               $partyemail=$row['partyemail'];
               $phone=$row['phone'];
               $idate=$row['idate'];

             echo "<tr><td><a href=\"home.php?num=$num\">$num</td><td>$firstparty</td><td>$secondparty</td><td>$partyemail</td><td>$phone</td><td>$idate</td></tr>";
            }
                echo"</table>";

issue: table with all fields except $num is getting displayed. entire column settlement Number($num) is blank and no errors

0

Sorry friends. please ignore my previous code and refer below code

 echo"<table width=\"85%\"  align=center  border=1>";
             echo "<tr><td>Settlement Number</td><td>FirstParty</td><td>SecondParty</td><td>Email</td><td>Phone</td><td>Created Date</td></tr>";
             while($row=mysql_fetch_array($sql))
             { $num=$row['num'];
               $firstparty=$row['firstparty'];
               $secondparty=$row['secondparty'];
               $partyemail=$row['partyemail'];
               $phone=$row['phone'];
               $idate=$row['idate'];

             echo "<tr><td><a href=\"home.php?num=$num\">$num</a></td><td>$firstparty</td><td>$secondparty</td><td>$partyemail</td><td>$phone</td><td>$idate</td></tr>";
            }
                echo"</table>";
0

are sure the column num exists in your database..or is it id?

also, if you don't mind, you can refactor your codes above to something less cluterry..

echo '<table width="85%" align="center" border="1">';
echo '<tr><td>Settlement Number</td><td>FirstParty</td><td>SecondParty</td><td>Email</td><td>Phone</td><td>Created Date</td></tr>';

while($row=mysql_fetch_array($sql))
{ 
echo '<tr><td><a href="home.php?num='. $row['num'].'">'. $row['num'].'</a></td>
<td>'. $row['firstparty'] .'</td>
<td>'. $row['secondparty'] .'</td>
<td>'. $row['partyemail'] .'</td>
<td>'. $row['phone'] .'</td>
<td>'. $row['idate'] .'</td></tr>';
}
echo'</table>';

Edited by veedeoo: info added

0

yes. column exist in db. Further if i remove a href tag. complete info is displayed without any issue.

So bit confused ...:(

i replaced my code with above mentioned code. But didn't get any claim num link

0

try these

 <?php
$html= '<tr><td>< a href="home.php?num=$num">$num</a></td><tr>';
$html.='<tr><td>$num</td></tr>';
 echo $html;
 ?>
0

It worked fine!! Let me share the same info to all...

Root Cause:link color was not selected and default it has taken white . So I couldn't notice the link (background color and link color was the same)and I just changed to link color . Thank you very much

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.