Hello every one i am having one doubt i have a set of links[url].Now there is pave ackages like 6 links,25 links package. if two user select 6 link each day and both will have same links[url] .now i when user log in then on adversitment page he visit each link one by one and as same set of link is with another user so i want to show these links to each user such that if particular user visit it then button become disable for it... following is code and table structure i am really confused with logic releated to this plz help...

below is how all links are shown to user

$query="SELECT * FROM links LIMIT $link_number";
// link number package type here 6

 $check=mysqli_query($connect,$query) or die(mysqli_error($connect));

 $i=0;

while($row=mysqli_fetch_assoc($check)){

            $id=$row['id'];

            $link=$row['link_link'];

            $date=$row['date'];

            $name=$row['name'];

            //$status=$row['status'];

            $pablo=$row['username'];

    ?> 

    <tr class="tdOdd"> <td align="center"><?php echo $id; ?></td> <td align="center"><?php echo $name; ?></td> <td align="center"><?php echo $date; ?> </td> <!--  <td align="center" >139.5.242.102</td>--> <td align="center"><button class="btn" style="background-color:#d9534f; color:#FFFFFF; padding:5px; " id="visitL"><a href="link.php?link=<?php echo $link."&bttn=".$id;?>">Visit Page </a></button></td> </tr> <?php
                   }
                   ?>

then after clicking button -

<td align="center"><button class="btn" style="background-color:#d9534f; color:#FFFFFF; padding:5px; " id="visitL"><a href="link.php?link=<?php echo $link."&bttn=".$id;?>">Visit Page </a></button></td>

if processed by link.php and data inserted into table viewed links having structure like this

id,username,link[url visted].

Any help ....

Recommended Answers

All 2 Replies

Now there is pave ackages like 6 links,25 links package. if two user select 6 link each day and both will have same links[url] .now i when user log in then on adversitment page he visit each link one by one and as same set of link is with another user so i want to show these links to each user such that if particular user visit it then button become disable for it

I'm so sorry, I really want to help you. However, I'm having a really difficult time understanding what you are trying to achive??

As your code stands, you're retrieving data on six links from MySQL. Then, you're looping through each one, storing its values into a bunch of variables. Then, looping through the next one, overwriting those values. You're not doing anything with them.

Then, you seem to be printing just the information about the last link into a table.

commented: yeah,exactly what this happening +2

Now this looping through each one gives me table like--

1  link[url]    visit_this_link button

2  link[url]     visit_this_link button 

and so on .....

and now if i click any of the button above that link will be visited by that user and should be highlighted in database that this link is been visited by this user but not other user which have many links in common.

for more simplicity take example i am printing 6 coupon code in table and there is button in front of every coupon code use this code as user clicks it is used by that user but same coupon code can be used by other users also[however this is what my scenario is] now i want to disable that use this code button for that particular user while enable for other user.

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.