Hi I am trying to find a simple way to record clicks from a links
Basically I have a simple list that displays data and then basically a link to a more info page for that specific record.
is there a simple function that can record either the click or the display of the second piece of data.. i would like to record it to a sql table?
all of the simple scripts I have seen use either flat files or are pretty complex
thanks in advance
here is the code that I am starting with
function user_couponDisplay()
{
databaseConnect (&$conn, &$db_id);
$sql = "select id, business_name, address, phone, coupon_title, coupon_description, terms, type, menu, menu_url, coupon from news order by business_name";
$results = mysql_query($sql,$conn) or die(mysql_error());
print "<table width='95%' border='0' align='center' cellpadding='2' cellspacing='0' bordercolor='#999999' bgcolor='#999999'>
<tr>
<td width='120'><strong>Business Name</strong></td>
<td width='120'><strong>Type of Business</strong></td>
<td width='120'><strong>Phone Number</strong></td>
<td width='120'><strong>Coupon</strong></td>
</tr>
</table>";
$bgcolor1 = '#DDDDDD'; // odd rows
$bgcolor2 = '#EEEEEE'; // even rows
$int = 0;
while ($temp = mysql_fetch_array($results))
{
$couponIDnumber = $temp['id'];
$business_name = $temp['business_name'];
$phone = $temp['phone'];
$type = $temp['type'];
$menu = $temp['menu'];
$menu_url = $temp['menu_url'];
$coupon = $temp['coupon'];
$bgcolor = $int++ % 2 ? $bgcolor2 : $bgcolor1;
print "<table width='95%' border='0' align='center' cellpadding='2' cellspacing='0' bordercolor='#999999' bgcolor='#999999'>
<tr bgcolor='$bgcolor' >
<td width='120'><strong><a href='functions.php?view_coupon=1&couponIDnumber=$ couponIDnumber'>$business_name</a></strong></td>
<td width='120'>$type</td>
<td width='120'>$phone</td>
<td width='120'><a href='functions.php?view_coupon=1&couponIDnumber=$ couponIDnumber'>$coupon</a></td>
</tr>
</table>";
}
}