Jump to content

neo_phyte

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

neo_phyte's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Anybody here used Wordpress as a blog? I have a problem in creating a query that displays all the content in cat_ID whose value is 4. The cat_ID field is found on the wp_categories table. I have to create a query that display the content based on the wp_posts table. Thanks in advance.
  2. How do I write a query that deletes the record and never deletes the maximum value of a certain unique field? Example: Shall we say I have 50,000 records of my table composed of fields such as first_name, last_name and scores, and I have 100 unique value of a 'last_name' field and each has a maximum value of column 'score' field. And I want to delete the repetitive 'last_name field' but not deleting the record that has the maximum value of column so that at least one record of that particular person remain in my table and that is the maximum value. How will I do that? Thanks in advance.
  3. MODIFICATIONS. Sorry To prove this: This link is the manual input of date and time. This is manually based on the output that I mentioned in my code. http://www.bacsafra.com/secondlifestuff/testing1.php This link is using the Y-m-d H:i:s http://www.bacsafra.com/secondlifestuff/testing.php
  4. sorry some modifications: This link is using the Y-m-d H:i:s http://www.bacsafra.com/secondlifestuff/testing.php
  5. To prove this: This link is the manual input of date and time. This is manually based on the output that I mentioned in my code. http://www.bacsafra.com/secondlifestuff/testing1.php This link is using the Y-m-d H:i:s http://www.bacsafra.com/secondlifestuff/testing1.php
  6. Yap, i am really sure that they are the same query. What i am doing is just changing the parameters of gmdate function. But it seems that they have different output.
  7. Sorry my subject is not emphasize more. No, the query is just the same with the first one... The difference is: $today = gmdate('2007-06-27 02:01:16'); //this is hardcoded based from the result $today = gmdate('Y-m-d H:i:s'); echo $today; $expire = gmdate('2007-06-27 23:59:59'); //this is hardcoded based from the result $expire = gmdate('Y-m-d 23:59:59'); echo $expire; to this: $today = gmdate('Y-m-d H:i:s'); $expire = gmdate('Y-m-d 23:59:59');
  8. I found hard to distinguish what is the problem with this query: $today = gmdate('2007-06-27 01:42:28'); $expire = gmdate('2007-06-27 23:59:59'); $sql = "SELECT avatar_name FROM $table where avatar_group = 'Avatrian Central' AND dt_detection > '$today' AND dt_detection < '$expire' group by avatar_name"; $result1 = mysql_query($sql); $numofrows1 = mysql_num_rows($result1); it returns a correct OUPUT but when I changed something like this: $today = gmdate('Y-m-d H:i:s'); $expire = gmdate('Y-m-d 23:59:59'); $sql = "SELECT avatar_name FROM $table where avatar_group = 'Avatrian Central' AND dt_detection > '$today' AND dt_detection < '$expire' group by avatar_name"; $result1 = mysql_query($sql); $numofrows1 = mysql_num_rows($result1); it seems that PHP stops working, it gives no output. Please advised. Can you explain to me...
  9. But how you add to the query when a certain avatar log off then later on shall we say 5 minutes he/she log on again, then that should log 2 counts for this statistics.
  10. So far this is what I have been doing, this is for current online. This is script returns nothing. $table = "tablename"; $today = gmdate("Y-m-d H:i:s"); $expire = gmdate("Y-m-d 23:59:59"); $result2 = mysql_query( "SELECT COUNT(*) FROM $table where avatar_group = 'Central' AND dt_detection BETWEEN $today AND $expire group by avatar_name"); $numofrows2 = mysql_num_rows($result2); where avatar_group is a name of the group and dt_detection is detection datetime type of file, it should count how many avatars on it. Thanks.
  11. I have here a simple table: avatar_name dt_detection Walegg Etzel 2007-05-30 19:51:41 Plotunium Paine 2007-05-30 19:55:03 Brain Cazalet 2007-05-30 20:03:55 Sebby Voyager 2007-05-31 08:05:31 Urban Loon 2007-05-31 08:08:31 Klaas Berjis 2007-06-01 08:09:05 Note: the date and time of detect is one field only. Now based on the table above, I would like to create two queries such as below: 1. Current online: Assuming the date right now is 2007-05-30, how do I create a query that display the number of avatar on a current date. 2. Total visits: This is the cumulative count for the number of avatar visits. It should not only be unique Avatar visits. For example, if Walegg Etzel visited. She leaves and then back later on. That should log 2 counts for this statistic). Thanks in advance.
×
×
  • 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.