Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

So sorry for the triple posts! I also just want to clarify that this method lets you send a comma-delimited text file to the web browser for downloading, which can easily be opened by any version of Microsoft Excel or any other spreadsheet program. It does not write an Excel file, specifically. For that, there are a handful of third-party PHP libraries for creating Excel files. Here is a link to one of them, PHPSpreadsheet.

deus d universo commented: Right now, I have the phpspreadsheet installed (I think, it's strange to do it on mac) but I don't know how to proceed, I'll search a bit more, thanks +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

If there is a javascript parse error in a different (unrelated) section of your code, it could prevent any javascript on your page from working.

Pranay_2 commented: i can try and trace it ill update you soon +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Do you now get any javascript console errors?

Pranay_2 commented: none the ones i get are for charts, however this page doesn't even include charts nor is there a link to any charts +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Sorry to hear. Has Microsoft since released a patch to whatever update was causing the BSOD?

kawaihu commented: Thank you, I learned +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

The documentation shows different button names.

I'm not sure what you're referring to? Can't anyone configure the buttons parameter passed into DataTable() to specify which buttons they want? Pranay_2 doesn't necessarily need to use the same buttons as in the simple example provided at that link.

I think I see the problem though. The code that you have says:

$(document).ready(function () {
    $('#tabela').DataTable({
        dom: 'Bfrtip',
        buttons: [
            'csv', 'excel', 'pdf'
        ]
    });
});

Note you are calling DataTable() on $('#tabela'). However, line 83 of your code has:

<table class="table table-bordered" id="tablea" width="100%" cellspacing="0">

It looks like the problem is you have a typo. The table has id tablea but you are selecting on id tabela.

Pranay_2 commented: Geez I may have missed that let me check and update you thank you +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

There are quite a handful of products out there that are parental control apps that should be able to do what you want. Unfortunately, I don't personally have experience with any of them to make a specific recommendation. The three I always hear about are Qustodio, Norton Family, and Net Nanny. You could also try Kaspersky Safe Kids.

As far as doing this yourself with vb.net, I will echo the sentiment of everyone else who has posted before me in this thread, and say that I'm not quite sure that's the right tool for the job. You would need a much lower level language than .net in order to take control of the operating system.

For example, there are some Windows Powershell commands to lock the computer or log off the current session. I'm sure there is some way to create a little timer via a shell script that simply locks the computer after X amount of time. Locking the computer won't close any apps or lose any saved work, but it will use the operating system's built-in security in order to regain access, so we're not talking about a little program that can easily be force-quitted with Ctrl+Alt+Del once the screen is locked.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi! Firstly, thank you so much for your kind words about DaniWeb, but I'm sorry to hear you're difficulty finding employment. I started DaniWeb back when I was still in college, and went into it full time when I graduated, so I was never in the position of looking for a programming job.

I have, however, hired developers for small to mid-sized projects on Upwork or Toptal. If you're underemployed, I would highly recommend supplementing your income with Toptal. It targets connecting entrepreneurs and small businesses with expert-level developers for small to mid-sized projects (typically a couple of months long). It's a great way to gain some practical experience to add to your resume, while making pretty good money at the same time. Upwork, on the other hand, in my opinion targets a little less discerning and more budget-conscious clientele.

Something else I would recommend doing is contributing to open-source projects on Github, and adding those to your resume as well. It's a great way to show that programming isn't just a job for you, but that you're passionate enough to do some side projects for fun that showcase your interests and skillset.

Something I don't like about your resume is that it says that you "learned about agile software development". When I read that, it sounds to me as if "learned about" is code for "I read a few paragraphs about it in a textbook at school once", and therefore you learned what it was, as opposed to actually …

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Yes, you have to first go to the discussion you want to respond to, and then you can reply to that topic.

If you click on the hamburger menu (the three icons to the left of the logo) it will bring up the navigation menu. In the "Your Content Finder" section you can click on "Topics & Posts". Within that section are links to:

Olive34 commented: I tried to reply but can’t always see the “reply to this topic” link, like now. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Is there a way to reply other than "Comment" link, then "Vote with Comment"?

Yes, just like this. Click on the "Reply to this topic" grey button right below the last post, or click on the purple bar at the bottom of the page.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Do you use any CSS frameworks such as Bootstrap? They typically include this functionality built into their javascript. Usually it’s called either a tree or an accordion, if I’m understanding you correctly.

I’m assuming you’re looking for something similar to what we have if you click the hamburger icon (three bars) to the left of our logo, and then drill down into one of the categories there in the navigation.

jonsan32 commented: That's exactly what I'm looking for. The 3 lines, but then an accordion. I've found a few, but they aren't multi level. I think it might be impossible +4
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I don’t think links from guest blogging is really effective anymore.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I wish I could help you but unfortunately I haven't looked at C++ code in two decades.

One thing that I would recommend you do moving forward is comment your code. At a minimum, each function should have a comment that says what it does. You should also comment each block of code to explain why you're doing what you're doing. For example, what does nrzombies() do? Why do you have if y < 9, set pmove = true? What happens when move is set to 56? All of these things might make perfect sense to you, the code author, but they're not understandable from the perspective of someone else seeing this for the first time. You probably, as well, wouldn't understand what's going on if you looked at this code in 6 months from now.

As well as creating classes and objects, IK would do something like this:

A human class with class methods of moveRight(), moveLeft(), moveUp(), moveDown(), draw(), etc..
A zombie class with class methods of moveCloserToHuman() and draw().

Then you can have something like a play() function that has pseudocode like:

human = new Human();
zombie1 = new Zombie();
zombie2 = new Zombie();
zombie3 = new Zombie();

human.draw();
zombie1.draw();
zombie2.draw();
zombie3.draw();

while (true)
{
    human.move();

    randomZombie = pickAZombie(); // pickAZombie() returns a random one of the three zombie objects
    randomZombie.moveCloserToHuman();
}

Because you have a human character moving around, and you have zombie characters moving around, it makes sense to me they should each be classes, …

JamesCherrill commented: Absolutely right. Even better call it pickARandomZombie and there’s no need for the comment. +15
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Constant Contact, Mailchimp, and SendGrid are the most popular ones that I'm familiar with.

rproffitt commented: My brother uses Constant Contact. +17
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I agree with everything you said except for optimizing email content with relevant keywords in subject lines, etc.

Email is not the same as your website. Email subject lines should be optimized to encourage users to open the email and catch their attention as they skim. Because email never gets crawled by search engine bots, there's no advantage to being keyword-rich and that sort of thing.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

When you removed the comment on the line

//echo "<br /><br />OU= $data<br /><br />";

What did it say the value of $data is?

If it doesn’t show anything, try var_dump($data);

nander commented: Here is the value $first = ldap_first_entry($ldap, $res); +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Yes, I understand that’s what’s failing, but it’s the second parameter being passed into that function. I can’t help unless I see the complete ldap.php file.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

My husband went through a phase a few months ago where he binge watched the entire series Gilmore Girls. Yes, my middle-aged husband is apparently a teenage girl.

Reverend Jim commented: How did he feel about Dawson's Creek? +0
rproffitt commented: When I had time recently I pulled up Red Dwarf and the entire UFO series. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi and welcome!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It sounds like the $entry variable that was passed in as the second parameter of the ldap_get_dn() function in ldap.php is most likely FALSE. This typically happens when the function that was used to populate $entry failed and returned false.

nander commented: Thanks for responding! So here is lines 25 and 26 the $first entry is failing $first = ldap_first_entry($ldap, $res); $data = ldap_get_dn($ldap, $fi +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It depends on what is being sold. For anything fashion related, trendy, or any products that are photogenic or visual, I would highly recommend Instagram.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

When you submit a form, then every form field and button gets submitted to the form. When using the GET method, each and every one of those fields (including the button) becomes part of the query string. When using the POST method, each and every one of those fields (including the button) gets submitted in the body of the HTTP request.

I'm not sure if this will work, but what happens if you remove the name property from the button? e.g. remove name="web_search_button". I'm not sure if that will work but it's just a thought.

Mindmade commented: It's kind of ok for me try for it. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

The shorthand of using ? and : is for assigning a value to a single variable in a simple and concise way.

Not everything is meant to be written in shorthand. When you have multiple things you want to do, echo something in a if-block but not in the else block, etc., then that’s what code blocks are for.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I need you to give me the label numbers of the ones that are invalid.

Aren't the ones that are invalid the ones that fail your tests?

And, I know the difference between "!=", "!==" and "!===".

There is no such thing as !===.

I always like to use extra parentheses just to make things as clear and easy-to-read as possible. I would personally do something such as this:

if(($num_rows = mysqli_stmt_num_rows($stmt)) === 0)

Of course, there's more than one way to skin a cat. (For those who are not native English speakers, it's a saying meaning there's always more than one way of getting something done.) Some of the methods you have here are just plain wrong, and some will still work, although aren't necessarily as clear. For example, $num_rows is a variable that one would presume holds a count of the number of rows. Therefore, expecting it to be either true or false doesn't make logical sense, even if it works when its value is 0 and you're testing == FALSE.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

What did you mean by:
"If you stumble upon an ad that is not directly relevant, please click on the "Report ad" link."
Are you suggesting this feature to me ?

All ads that are purchased with Google Ads have a Report ad feature. I was responding to the discussion about ads being irrelevant, and how advertisers can't simply pay for placement without meeting quality and relevancy thresholds.

Anymore features you thought-up recently ?

My response back in December was, "More of what Google does (and is doing more and more of) in terms of answering questions directly without having to visit any links." Now we have ChatGPT and the like, and Bing is really embracing integrating it into its search functionality. That's basically the direction I see search going in.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

You always need to close any parentheses or brackets that you open.

trim() is a built-in PHP function that works like: $string = trim($variable);

The third example you have given first trims the password passed in via POST, and then it takes the trimmed value, and passes it into the password_hash() function.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I absolutely refuse to acknowledge anything from Office Space. Dumbest. Movie. Ever. And then, at the end, he decides he wants to be a construction worker?

rproffitt commented: Humor, but that's not important right now. I like that new member "Maul." +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Basically what's happening is the backslash has the meaning of escaping the character that comes after it. The problem is that you seem to be using multiple character sets and then doing PHP conversions with iconv(). Just make everything use UTF-8 and simplify everything.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello,

The problem is that you are not properly escaping the author or book name when entering them into the database. I wrote an article here about the importance of doing this.

This is what your code should look like when querying the database:

$result = (mysqli_query($con,"SELECT * FROM authors WHERE name = " . $con->real_escape_string($_POST[authorName])));
$result = (mysqli_query($con,"SELECT * FROM books WHERE bookTitle = " . $con->real_escape_string($_POST[bookName])));

Also, you should not have to use iconv(). Instead, it's best for your database to store data in UTF-8 format, as well as for your connection to MySQLi to use UTF-8.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I'm still unsure of what you mean by taglines. Do you mean DaniWeb's forum signatures? Or do you mean DaniWeb's user titles (e.g. "Nothing to see here.")?

rproffitt commented: Taglines is the term I know from the past. Here it's "forum signatures." +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Your method will spit out more and more incorrect results over time.

Stefce commented: Why ? +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

What happens if users just keep hitting the start button and then leaving the site and never hit stop? Won’t the counter just keep incrementing indefinitely and then be more and more inaccurate for each user that doesn’t press stop?

Stefce commented: Yes thats true and i am trying to figure it out +12
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

So you think they should just not hire any experienced engineers, not hire any novice engineers, and just hire an AI chat bot?

jwenting commented: it's almost like rproffitt is using chatgpt to write answers and it's advertising itself. +16
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Again, that has nothing to do with their question. They are hiring an engineering team and asking if it would be more efficient to hire a senior-level engineer who is not as motivated, or a junior-level engineer who is more motivated and driven, and why or why not? The skillset they are hiring for is irrelevant to the question, although, as you can see above, I did ask what their budget is like and the complexity of the project.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

What do you mean if you don’t know ChatGPT you won’t get the job? Its first demo wasn’t released until a few months ago and its API didn’t launch until yesterday. Other than reading news articles about it and playing around with a demo, a developer hasn’t been able to use it until yesterday afternoon. Also, that has absolutely nothing to do with their question.

To answer the question, I guess I would want to know how complex the project is and what the project’s budget is like.

For example, you can hire 50 realllllllllly super, super passionate and motivated people, but if they are all novices trying to accomplish something that requires an expert-level understanding of how to do something, they will be wasting a lot of time spinning their tires trying to learn.

On the other hand, one expert might not be particularly excited about the project, but it’s something he can do in his sleep, and it will take him no time at all.

I think it’s important for there to be a healthy mix of being knowledgeable and skilled enough to know how to do what you’re being hired to do, or at least know how to access and utilize the resources to figure it out rather quickly, but also being at least somewhat motivated and excited about the project.

So my answer to your question is that it really depends and comes down to the complexity of your project. You don’t have …

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

In an email conversation I was having with Jim last week, I wrote:

It’s a lot easier to google something than it is to find DaniWeb, sign up, create a username, activate your email address, navigate to the contribute page, come up with a topic title, figure out what tags to use, and type out a question. No one who posts on DaniWeb is being lazy. They might not know the right question to ask, or how to frame it, or what to include or not include. But they already crossed a lot of barriers and “put themselves out there” just to ask.

Then, fast forward to yesterday, and Jim and I both come across this thread where it's obvious that someone posted a homework question and then seemingly disappeared never to be seen again.

That got me thinking, so I did some investigating, and discovered that this user never verified their email address. That means that they never received any notifications that there were any updates posted in this thread, and, as a new member, no way of easily finding this thread again. (They would have to know to click the hamburger menu next to the logo, then click on Topics & Posts, then click on Topics You've Started, which isn't super intuitive for someone who has spent all of one day on DaniWeb.)

So, if anything, this is an onboarding bug. We let new users start threads without clicking a link emailed to them to …

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I was just thinking, and other software that I go directly to the website to download are things like Zoom, GoToMeeting, TeamViewer, Skype, etc. As mentioned, I can't think of a single time I have ever used the App Store on my mac.

rproffitt commented: Developers are different. I haven't seen a virus in decades either except on client machines. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Have you tried adding console.log() debug statements within each conditional to see if the correct branch of the if-else statement is being triggered each time you hit start/stop?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Most if not all Apple users stick to the Apple store.

That is not my experience at all. I have never installed an app onto my mac from the Apple Store.

rproffitt commented: Interesting. The majority of the Apple users I know don't write code so they can stay in the garden. +17
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi Maul! Thanks for taking the time to join here, as well as for the delicious cookie. I'm actually browsing DoorDash now, as I type this, because now I have a craving for a dessert and a virtual cookie just doesn't quite cut it.

Maul commented: You're right. Nothing is better than an actual cookie! +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

To rproffitt's point, fx.eko, what operating system are you running? Do other VB6 apps run perfectly fine on it? Have you ever experienced any issues like this before? Did Windows Update recently run and perhaps upgrade something that broke VB6?

My view is that VB6's time passed years ago.

I agree that VB6's time passed many years ago, although I have a soft spot for it as it was one of my first programming languages. (I went from BASIC on an Apple IIGS when I was 4 years old, to QBASIC when I was 10 or 11, to Visual Basic 4 and then VB6 when I was 12/13ish. I think that timelines is about right, although don't quote me on it :)

But to go back to fx.eko's question, did the Microsoft article I linked you to yesterday help at all?

Good luck!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Where did you attempt to put the code that didn’t work? I’m not seeing it in your full code. Also, the code you are saying isn’t working is just a conditional that checks the size/placements of picturebox1 and pixturebox2 with respect to each other. It doesn’t actually move either of them.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

My library of course uses MySQLi in order to connect and query the database. What I did is rolled my own ORM, which is a technique used to map my PHP objects to rows in my database. That's why I can do something like the above, in which the push_to_db() function then uses PHP's mysqli library to push the appropriate SQL query to the database. In other words, really all that it does is write simple SQL queries for me.

borobhaisab commented: Very good! +4
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

if(mysqli_stmt_execute($stmt)===FALSE) is actually more proper than if(mysqli_stmt_execute($stmt)==FALSE). However, in this particular case, because mysqli_stmt_execute() always returns either true or false, and never any other values, technically both will work.

You see, PHP is a loosely typed language, and sometimes functions return 0 or NULL, and sometimes they explicitly return FALSE. Per php.net documentation, mysqli_stmt_execute only returns true on success or false on failure. However, an example of a function where this gets a little dicey is strpos which returns the numeric position of the first occurrence of a substring in a string, or false if not found. That means if the substring is found at the beginning of the string, it will return 0, but if the substring was not found, it will return false. However, in PHP, FALSE == 0. There is even a warning on that page, you can see.

If you want to test for something specifically being false, you can do === false, or specifically not being false, you can do !==. If you just do double equals, ==, then the expression will evaluate to true if function_name() returns 0 or null, for example.

You see, NULL == FALSE and 0 == FALSE, but NULL !== FALSE and 0 !== FALSE.

I hope this made a little bit of sense to you. I know it can be a little confusing.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Also, that last section is still incorrect. You cannot mix PHP variables into your javascript.

Stefce commented: I should replace the JS code i have, with the one you posted? +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It doesn’t add a new row to the table each time you refresh the page?

Stefce commented: yes, thats correct +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

On miningbot.html, you currently have:

// Update the live visitor count on the page
const visitorCountElement = document.getElementById('visitor-count');
setInterval(() => {
  fetch(`get_visitor_count.php?id=${id}`)
    .then(response => response.text())
    .then(count => {
      visitorCountElement.textContent = count;
    });
}, 5000); // Update every 5 seconds

Do you have a <div id="visitor-count"></div> element on that page?

Stefce commented: Yes i got the <div> element +12
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Per our live chat, you are a bit confused what I'm referring to.

For now, let's leave miningbot.html alone. I have not confirmed that it should work, but it most likely would. It looks decent enough, although of course you have to have a <div id="visitor-count"></div> element.

Then for get_visitor_count.php, simply do:

<?php
// Get the id value from the GET request
$id = $_GET['id'];

// Connect to the SQL database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database_name";

$conn = mysqli_connect($servername, $username, $password, $dbname);

// Escape the string
$id = mysqli_real_escape_string($conn, $id);

// Get the visitor count for the corresponding id value
$sql = "SELECT SUM(*) AS count FROM visitor_counts WHERE id = '$id' AND timestamp > NOW() - INTERVAL 15 MINUTE";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$count = $row['count'];

// Close the database connection
mysqli_close($conn);

// Output the visitor count as plain text
echo $count;
?>

And for update_visitor_count.php, simply do:

<?php
// Get the id value from the POST request
$id = $_POST['id'];

// Connect to the SQL database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database_name";

$conn = mysqli_connect($servername, $username, $password, $dbname);

// Escape the string
$id = mysqli_real_escape_string($conn, $id);

// Increment the visitor count for the corresponding id value
$sql = "INSERT INTO visitor_counts (id, timestamp) VALUES ('$id', NOW())";
mysqli_query($conn, $sql);

// If there's no other place for it, you can put it here
$sql = "DELETE FROM visitor_counts WHERE timestamp < NOW() - INTERVAL …
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

rproffitt, what is WiPro?

farman, I would answer this question by saying experience with both front end and back end development nowadays. I don't mean the developer needs to also be the designer / UI/UX person, but AJAX, websockets, etc. have made it necessary for backend devs to also have a strong grasp of frontend html, javascript, CSS.

In terms of the single most essential skill nowadays, I would say Javascript. That, and maybe a CSS framework like Sass.

rproffitt commented: It's a very large IT company in India. Some companies I consulted with used them. +17
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It sounds to me like you are in a class learning to convert pseudocode to C++. Can you please show us the pseudocode you're working with?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

So the PHP code that you have here is definitely just a counter that increments itself by 1 every time someone visits the page, so it doesn't reset itself ever or just show currently active visitors.

miningbot.html JS: Here it looks like we're making an AJAX post request to update_visitor_count.php and sending the value of the ?id= parameter of the current page, and then we're also updating the visitor count every 5 seconds by fetching get_visitor_count.php via AJAX as well.

The problem you have here is in the way the visitor_counts table in the database is structured. As it currently stands, it has two columns: id, and count. Each time a visitor with an id visits, that row's count column is updated.

Typically something like this isn't handled via MySQL (here at DaniWeb we use Redis), but because you're on a shared web server, they probably won't let you install Redis. Therefore, you can make do with MySQL by instead creating a whole new row in the visitor_counts table each time someone visits. The visitor_counts table should have two columns, id and timestamp. Each time someone visits, you could do:

INSERT INTO visitor_counts (id, timestamp) VALUES ('$id', NOW())

Be sure to escape $id first, or use prepared statements, so that you don't introduce an SQL injection attack. Let me know if you're not quite sure how to do that or need some extra help. Here's a little tutorial on how to sanitize PHP user input strings I whipped up.