Current location: Hot Scripts Forums » Programming Languages » PHP » Record Clicks


Record Clicks

Reply
  #1 (permalink)  
Old 09-26-06, 06:14 PM
cyberfolli cyberfolli is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 93
Thanks: 8
Thanked 0 Times in 0 Posts
Record Clicks

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>";
}

}

Last edited by cyberfolli; 09-26-06 at 06:25 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
limit the inserted record hubby ASP 1 09-08-06 11:07 AM
scrolling in record pallabmondal123 PHP 0 03-27-06 07:01 AM
Phase Previous and Next Record pallabmondal123 PHP 1 03-03-06 01:55 AM
1 record missing sjems PHP 8 04-26-05 04:09 AM
Can't Retrieve New Record Database mathieu67 PHP 2 09-27-04 04:24 PM


All times are GMT -5. The time now is 05:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.