Please bare with me, I am not a programmer and a newbie at coding.

I am trying to develop a way to track how many users click back from my emails to my website. I am able to created a simple MySQL database.

Here is what I want to do, please let me know if this is easily feasible. In my database, I will have these fields. email (primary), name, country, status, date. I am using a simple php script to let users add and delete themselves into the database. Users would fill in email, name, country and the database will suto fill in status and date. Here is the tricky part which I don't know how to implement. Could I make it so that upon signing up, the status field in my database automatically inserts a 0 (0 = indicating that user sign up). Putting a link in my email/newsletters with a tag code in it (sorry about the novice language, I am not a programmer) so that once the user clicks to come back to my site, the database "status" field changes from 0 to 1. Now, when I look at the database, I will know how many users actually clicked back to my site from my emails. Hope this makes sense. I am able to develop a simple database in MySQL and use simple php codes to let users sign up and unsubscribe from my list. I don't know how to implement the status field of 0 & 1 (either in MySQL or using the php code to change the status or put a tag in my emails so I can track users). Also, would it also be easy to make the counter go higher than 1 if the user went back to that email and clicked on it the 2nd time? Can you help? Any asistance would be greatly appreciated!

Sincerely,

Bowmah

    Well the solution to this problem is simple.

    UPDATE tablename
    set status=status+1;
    [ WHERE condisions ]
    [ LIMIT number ]

      thanks for the info,

      i am actually not at that point yet. i have just figured out that using this code in my html will POST a "0" to my php script which adds a "0" to the table in MySQL database.

      but here is the problem and here is my code:

      <SELECT NAME="firstclick">
      <OPTION VALUE="0" SELECTED>

      I want to call this field firstclick and add "0" to the table in my database. it worked but the html page has an ugly text field (drop down menu) on it. How can I make the "0" POST to my php script and not have it show up on my html page when viewed in a browser?

      Here is my php script as well:

      <?php
      echo "<TITLE>Thank you for your subscription</TITLE><BODY>";

      $db = mysql_connect("sqlserver", "databseloginID", "databasePW");
      mysql_select_db( "database_name",$db);
      $sql = "INSERT INTO table_name(email, first, gender, country, age, firstclick, date) VALUES ('$email', '$first', '$gender', '$country', '$age', '$firstclick', CURRENT_DATE)";
      mysql_query($sql,$db);

      //echo "$email $first $gender $country $age '$firstclick' $Current_Date";
      echo "</BODY>"
      ?>

      thanks for the help! much appreciated!

      Bowmah

        Hi Pavel,

        Can you still help me? thanks in advance.

        Bowmah

          Write a Reply...