| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() | MySQL Not Returning the Right Results I have this code: PHP Code: |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() | Yes, 22. When I do a SELECT DISTINCT query later in the script, it only returns 2, where it should return many more. I just emptied the table, and both queries (SELECT, SELECT DISTINCT) return 1. |
| |
| | #4 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Why don't you use mysql_num_rows ?
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | #6 (permalink) |
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,272
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Weird.. That actually should work.. But for some reason it isn't.. I suspect there is another problem somewhere causing it only to extract 22 rows.. Hrm.. I shall investigate.. - Steve
__________________ I feel old. |
| |
| | THREAD STARTER #7 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() | I have another problem. Completely unrelated to the original thread, but I didn't think starting another thread would be a good idea. I have this code: PHP Code: PHP Code: I don't need the minute or second for this, so I try to get them out with a substr statement, but it doesn't work correctly. I tried date("m/d/Y - H",$result1['v_created']), but that didn't work either. It returned dates from 2030-something. Any help would be appreciated
Last edited by Tree; 03-24-2006 at 06:47 PM.
|
| |
| | #8 (permalink) |
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: |
| |
| | THREAD STARTER #9 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() | I'm sad that I "must spread some Reputation around before giving it to SecondVersion again." Thank you very much, 2v! Although my query to display how many people in that hour still returns nothing. PHP Code: |
| |
| | THREAD STARTER #11 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() | Alright, now it displays many records for the same hour. Site: http://www.vestieo.com/manage Username: foo2 Password: foo2 My Sites > Any of the site names Anyone know how to make it display only one record per hour? If all of you would please register via the link in my sig, I'd appreciate it. It is for this script that I'm working on. All you need to put in is your age and gender. As per policy, you must be at least 13 years old to register.
Last edited by Tree; 03-24-2006 at 07:16 PM.
|
| |
| | THREAD STARTER #16 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() | Upgrade is complete, and MySQL 4.1 stores timestamps as "YYYY-MM-DD HH:MM:SS". So would an "explode" function work instead of a "substr"? Wow, I didn't know it was possible to stump 2V. I thought about all the different ways, but couldn't find one that worked. Just so everyone knows, this isn't a private conversation, feel free to post any of your input as well. Please register in the link in my sig. All you need to put in is your age and gender. I just need some random data from all over the world.
Last edited by Tree; 03-25-2006 at 05:39 PM.
|
| |