Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 21:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Web Development

Discussion on Web Development within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2010
Posts: 231
Received Thanks: 20
Web Development

I need help in getting values from database and converting them into a clickable link or url for the viewers..

Note: I bolded the part where the "link" is fetched from the database.. Thank you in advance!
Side Note: Here's my output example ()

Source Code:
<?php include 'template-parts/header.php' /** calling of header(to make it uniform in all template file) **/?>
<div class="container home" style="height:800px; opacity: 0.9; background-image:url(images/innerboard.jpg); background-repeat: no-repeat; margin-left:60px;">
<h3 style="margin-top:70px; color:white;text-shadow: 1px 6px 5px #050505;"><center>View Reference </center></h3>
<h3 style="margin-top:10px; color:white;text-shadow: 1px 6px 5px #050505;"><center>You may view your reference here </center></h3>
<?php include "connection.php" /** calling of connection.php that has the connection code **/ ?>
<table class="table table-bordered" style="margin-top:90px; width:90%; margin-left:40px;" >
<thead>
<tr style="background-color:#0E93FA;">

<th style="width:25%;"><center>Subject</center></th>
<th style="width:30%;"><center>Website Link</center></th>
<th><center>Description</center></th>
<th style="width:150px;"><center>Command</center></th>
</tr>
</thead>
<tbody>
<?php
$result = mysql_query("SELECT * FROM tbl_reference");

while($data = mysql_fetch_object($result) ):

?>
<tr style="background-color:white;">
<td><?php echo $data->subj?></a></td>
<td><?php echo $data->link?></td>
<td><?php echo $data->description?></td>
<td><center>
<a href="updatebyId**********id=<?php echo $data->id ?>">
<button class="btn btn-info"style="text-shadow: 1px 3px 5px #050505;"> Edit </button>
<a href="deleteById**********id=<?php echo $data->id ?>">
<button class="btn btn-danger" style="text-shadow: 1px 6px 5px #050505;" > Delete </button></center> </td>
</tr>

<?php
endwhile;

?>
</tbody>
<center>
<a href="createref.php">
<button class="btn btn-info" style="text-shadow: 1px 3px 5px #050505;"> Add Reference </button></center>

</table>

</div>
</div>
</body>
</html>
clampzy is offline  
Old 11/25/2014, 08:02   #2
 
Mikesch01's Avatar
 
elite*gold: 203
Join Date: Sep 2007
Posts: 732
Received Thanks: 190
Very basic HTML knowledge:

Mikesch01 is offline  
Old 11/28/2014, 21:07   #3
 
Warnuk3r's Avatar
 
elite*gold: 307
Join Date: Jul 2009
Posts: 1,091
Received Thanks: 434
PHP Code:
<a href="$data->link">$data->link</a
Warnuk3r is offline  
Reply




All times are GMT +2. The time now is 21:56.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.