Jump to content

Epidemic

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Epidemic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The users who use my panel have 2 options for each item. They can buy a 1 month auth, or a lifetime auth. There are three products, fletch, plank and fire. I am trying to count the total amount of auths bought by seeing how many 1's there are in the Unl columns and how many server times that are bigger than the current time in all the columns.
  2. The code I was using before would only count a user if they had 1 type of auth. But if they had 2 it would still count it as 1. So I tried this code instead. But it is only returning 0. <?php include "config.php"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("Database does not exist!"); $query1="SELECT COUNT(*) FROM members WHERE fletchUnl = '1' OR fletchExpiration > UNIX_TIMESTAMP()"; $result1=mysql_query($query2); $query2="SELECT COUNT(*) FROM members WHERE plankUnl = '1' OR plankExpiration > UNIX_TIMESTAMP()"; $result2=mysql_query($query3); $query3="SELECT COUNT(*) FROM members WHERE fireUnl = '1' OR fireExpiration > UNIX_TIMESTAMP()"; $result3=mysql_query($query4); $totalFletch = $result1; $totalPlank = $result2; $totalFire = $result3; echo $totalFletch + $totalPlank + $totalFire; ?>
  3. Hey, I have got an old username and password database for my users of my websites. However when I first made my website I didn't know about MD5 encryption, but I now do. However I want to MD5 all of there passwords in my members table. Is there any SQL query I can use to MD5 all the passwords in the passwords collum? I really do hope there is because otherwise I have 200 + passwords to MD5. Josh
  4. That was the sort of thing I was thinking of but I didn't know you could use OR or > in MySQL. I am currently using: <?php include "config.php"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("Database does not exist!"); $query="SELECT COUNT(*) FROM members WHERE fletchUnl = '1' OR plankUnl = '1' OR fletchExpiration > UNIX_TIMESTAMP() OR plankExpiration > UNIX_TIMESTAMP()"; $result=mysql_query($query); echo $result; ?> But it is returning "Resource id #4". Any ideas on what is causing this?
  5. The fletch and plank are my product name prefixes and I just do booleans as ints. It's the way I learnt. I am just trying to make a statistics part in my website and I want to count how many people who have currently got access to the script.
  6. I have my database set out like so, The expiration fields are where the server time + one month are place and the Unl fields are where 1 or 0 is stored. This is what I have so far, <?php include "config.php"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("Database does not exist!"); $result1 = mysql_query("SELECT * FROM $tbl_name WHERE fletchUnl = '1'"); $num_rows1 = mysql_num_rows($result1); $result2 = mysql_query("SELECT * FROM $tbl_name WHERE plankUnl = '1'"); $num_rows2 = mysql_num_rows($result2); $num_rows = $num_rows1 + $num_rows2; echo $num_rows; ?> This counts the unlimited auths but not the monthly ones.
  7. That will count the users who have an unlimited auth but some users don't have that and have a monthly time. The monthly time is done by using the current server time and adding one month on top of it, and storing it into the database, in its own separate field. Then the auth runs out after the current server time goes past the server time I have stored in the database.
  8. Hey, I am trying to count how many members in my authentication panel have bought an auth. So I want to be able to count how many members have one month auth which uses the server time to set when the auth will run out (so when you buy an auth it will add 1 month of seconds to the server and store it in the database). I am also offering unlimited auths which is done by changing an int from 0 to 1. All I want to do, I want to count how many people have got a 1 month auth and an unlimited auth and display it as one number. I know how to count the total rows but I don't how to do this. Any help would be great! Josh
  9. I'm using: <table height="100%" width="150px"> But it isn't stretching the whole page. There is a white gap at the bottom.
  10. Hey, I want to use a table with a black border only on the right hand side to create a navigation bar. The table will be on the very left hand side of the page and run the full height of the page. However I do not know how I can get the table to run the whole way down the page and just have a 1 pixel black line border only on the right hand side of the table to create a single line down the left hand side of the page to create a navigation bar. My example: Hope you can help. Josh
  11. How would I go about using a time stamp?
  12. Hey, I am making an authentication panel and I want my users to be able to have access to a script for one month. However I do not know how to time one month in PHP. Well 31 days to be honest. I was wondering if anyone could help me out. I want to be able to change an int in my database to 1 for 31 days and after those 31 days change it back to 0. I also want to return how many days they have left until the int is returned to 0. Any help would be greatly appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.