I'm very new to PHP and am trying to get one column (called LINK) of data to be displayed in the table, however as a hyper-link. I wish the user to be able to click on the link in order to launch a new quiz for example. Basically I need what is to be displayed by line 81 to be in a hyper-link format.
Table Display :
Table Display :
Code:
<?php require_once('Connections/Education.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_rsMath = 10;
$pageNum_rsMath = 0;
if (isset($_GET['pageNum_rsMath'])) {
$pageNum_rsMath = $_GET['pageNum_rsMath'];
}
$startRow_rsMath = $pageNum_rsMath * $maxRows_rsMath;
mysql_select_db($database_Education, $Education);
$query_rsMath = "SELECT * FROM maths ORDER BY Grade ASC";
$query_limit_rsMath = sprintf("%s LIMIT %d, %d", $query_rsMath, $startRow_rsMath, $maxRows_rsMath);
$rsMath = mysql_query($query_limit_rsMath, $Education) or die(mysql_error());
$row_rsMath = mysql_fetch_assoc($rsMath);
if (isset($_GET['totalRows_rsMath'])) {
$totalRows_rsMath = $_GET['totalRows_rsMath'];
} else {
$all_rsMath = mysql_query($query_rsMath);
$totalRows_rsMath = mysql_num_rows($all_rsMath);
}
$totalPages_rsMath = ceil($totalRows_rsMath/$maxRows_rsMath)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body><?php echo "HELLO WORLD" ?>
<p> </p>
<table border="1">
<tr>
<td>MathsID</td>
<td>Grade</td>
<td>Topic</td>
<td>Date</td>
<td>Link</td>
<td>Image</td>
<td>Set</td>
<td>Author</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rsMath['MathsID']; ?></td>
<td><?php echo $row_rsMath['Grade']; ?></td>
<td><?php echo $row_rsMath['Topic']; ?></td>
<td><?php echo $row_rsMath['Date']; ?></td>
<td><?php echo $row_rsMath['Link']; ?> </td>
<td><?php echo $row_rsMath['Image']; ?></td>
<td><?php echo $row_rsMath['Set']; ?></td>
<td><?php echo $row_rsMath['Author']; ?></td>
</tr>
<?php } while ($row_rsMath = mysql_fetch_assoc($rsMath)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($rsMath);
?>
Comment