i want to create the database retrieved datas as hyperlink using php.i have sent the code.please tell me how to edit the below code
<td><font color="red">View All Posting</font>
<td><a href="care.php">Create New Users</a></td>

$hostname = "localhost";
$username = "splendor_lydia";
$password = "jesus";
$dbid = "splendor_samp";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");

echo "<table width='60%' border='1' style='padding-right: 6px'>";
$result=mysql_query("SELECT jobtitle FROM please");
print "<tr><td>jobtitle </td></tr>";
for ($i = 0; $i < mysql_num_rows($result); ++$i)

$line = mysql_fetch_row($result);
print "<tr><td>$line[0]</td></tr>";
echo "</table>";


replace this part:

print "<tr><td>$line[0]</td></tr>";

with this part:

print "<td><tr><a href='".$line[0]."'>$line[0]</a></td></tr>";

thanks it is working

Can anyone help me with this code? I have been trying to output the url as a link but I cannot manage to do so. The url comes out fine in text form but when I try to output the url as a link I either get an error message or all of the url is not in the link. The code works without errors as I have it posted here but all of the url does not appear in the link. It seems anything I add after video_id. either produces and error or the var lable is output instead of the var value. I have been working on this for hrs. I know it must be something simple but I just cannot figure it out.

Thanks in advance



$txt = file_get_contents('http://youtube.com/watch?v=Z_qBWLAdKoE');

preg_match('/video_id:\'[\w]{11}\'/', $txt, $video_id_temp);
$video_id = $video_id_temp2[0];

$l = $l_temp2[0];

$t = $t_temp2[0];

echo "http://youtube.com/get_video.php?video_id=".$video_id."&l=".$l."&t=".$t;

print "<td><tr><a href='".$url.$video_id."'>   Download</a></td></tr>";


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.