• What are you working on? V4 (HTML ISN'T PROGRAMMING)
    2,003 replies, posted
[QUOTE=a2h;17841758] :psyduck: And I haven't even tried to find a way to order by comment if it exists otherwise when the issue was opened.[/QUOTE] Why don't you cache the last comment ID in the bug report row?
[QUOTE=SteveUK;17841788]Why don't you cache the last comment ID in the bug report row?[/QUOTE] Won't that still involve having to query for the rest of its information from its ID?
[QUOTE=a2h;17841802]Won't that still involve having to query for the rest of its information from its ID?[/QUOTE] Well at least then you can have a working JOIN, if you want cache the author ID and time.
[code]$result_issues = db_query( "SELECT * FROM issues LEFT JOIN (SELECT IFNULL(comments.author,issues.author),comments.when_posted FROM comments ORDER BY when_posted DESC LIMIT 1) AS comments ON issues.id=comments.issue ORDER BY issues.when_opened DESC" );[/code] This doesn't work and my mind has bursted from trying to get it to work, the one a few posts above works but author is empty if there is no comment to select. /goestobed
Well, I tested out some JOIN's, I can't believe I missed it, it's just so much simpler and better: [code] SELECT brews.name, users.username, companies.name FROM brews INNER JOIN users ON brews.userid = users.id INNER JOIN companies ON brews.companyid = companies.id [/code] Problem is, brews.name and companies.name exist, so I'm not sure how to tell the difference in those cases, since I really only need the names.
try something like SELECT issues.id (etc), comments.author, comments.etc FROM issues LEFT JOIN comments on issues.lastcomment = comments.id ORDER BY blah blah selecting * is also considered bad form - you should select only what you need. [editline]12:13PM[/editline] [QUOTE=PoliticalM;17841848]Problem is, brews.name and companies.name exist, so I'm not sure how to tell the difference in those cases, since I really only need the names.[/QUOTE] SELECt brews.name as brewname, companies.name as companyname, etc
[QUOTE=garry;17841851] SELECt brews.name as brewname, companies.name as companyname, etc[/QUOTE] I [i]literally[/i] just typed that out, was about to say I've sorted it. Thanks :)
Not very exciting [img]https://dl.getdropbox.com/u/99765/543588.png[/img] Scrapes the item name, item desc and item prices from the RuneScape grand exchange([url]http://itemdb-rs.runescape.com/frontpage.ws[/url]) and whacks it all into a database to be used for whatever. Can scrape about 1000 pages per minute so it only takes a few minutes to update every item price in the database. Can be used to scrape other stuff obviously
[QUOTE=a2h;17841829]This doesn't work and my mind has bursted from trying to get it to work, the one a few posts above works but author is empty if there is no comment to select. /goestobed[/QUOTE] That's now how joins work, you don't put in a query within it. And if you use a LEFT JOIN the field will be blank if there isn't a comment on that particular item (refer to garry's post)
[QUOTE=Maurice;17839318]I made a program which tells me where I have my mouse the most. [img]http://filesmelt.com/downloader/mousefollower.png[/img] (About 8 minutes of browsing around) It's pretty random, except I have my mouse more on the left side of the screen. [B]Edit:[/B] Another pic, this time about 20 minutes. The black dot is my bookmarks button. (I think) [img]http://filesmelt.com/downloader/mousemove.png[/img][/QUOTE] Possible to get a download? would be interesting to know.
My friend invited me to google wave I cant wait to play with it on the weekend!!!
Is there a way to select no fields or something similar to count the full amount of rows as fast as possible?
[QUOTE=Overv;17843461]Is there a way to select no fields or something similar to count the full amount of rows as fast as possible?[/QUOTE] I tend to use the shortest column, ID or something. Other than that, not sure there is.
[QUOTE=Overv;17843461]Is there a way to select no fields or something similar to count the full amount of rows as fast as possible?[/QUOTE] [url=http://dev.mysql.com/doc/refman/5.1/en/counting-rows.html]SELECT COUNT in MySQL.[/url]
[QUOTE=garry;17841851]try something like SELECT issues.id (etc), comments.author, comments.etc FROM issues LEFT JOIN comments on issues.lastcomment = comments.id ORDER BY blah blah selecting * is also considered bad form - you should select only what you need. [editline]12:13PM[/editline] SELECt brews.name as brewname, companies.name as companyname, etc[/QUOTE] The disadvantage to that is if you add more columns, you have to add them to all your queries too.
[QUOTE=a2h;17841239]I've replaced instances of mysql_real_escape_string in my code with a ...[/QUOTE] Wait, what? Why? Putting \\' into a string would do nothing, mysql_real_escape_string covers this!
I just made a button for my game gui :D. I don't know how with my current system I can make it work. I will find a way.
[QUOTE=Maurice;17839318]I made a program which tells me where I have my mouse the most. (About 8 minutes of browsing around) It's pretty random, except I have my mouse more on the left side of the screen. [B]Edit:[/B] Another pic, this time about 20 minutes. The black dot is my bookmarks button. (I think) [/quote] That's a cool idea, here is a similair thing I made (I did some post pro stuff in photoshop (blur, increase brightness), I'm still working on the code to do it automatically ) [IMG]http://www.cubeupload.com/files/2ed800output.png[/IMG]
That could be useful for usability testing.
Those programs are really cool, I would make one but I don't really know how.
[QUOTE=ZomBuster;17845873]That's a cool idea, here is a similair thing I made (I did some post pro stuff in photoshop (blur, increase brightness), I'm still working on the code to do it automatically ) [IMG*]http://www.cubeupload.com/files/2ed800output.png[/IMG][/QUOTE]That's neat. Maybe have it create a second image to show you where you click the most?
Or have red dots for clicks, using transluscency of course.
woah I screwed up my blur and resample code [URL=http://www.cubeupload.com][IMG]http://www.cubeupload.com/files/bc0c00output.png[/IMG][/URL]
Well; I'll probably never upload any of my scripts because they're all so shit. For example, for this script I need a source.png on C:\ because I can't figure out how to create a graphic, so I load one in. Just wait for zombuster's, his looks way better anyway.
Porting the Steam Community to an iPhone / iPod Touch Format. :D Still kinda betaish but It's almost done. :) (I would like to talk to Valve about integrating the ability to edit your profile but I [B]doubt[/B] that they would even remotely consider it. Consider this as a view-only type of thing. :P) This didn't take much PHP but was fun to create a DOM to scrape the pages [the XML doesn't include all of the friends' avatars, name, statuses in /friends?xml=1]. :D [img]http://andersonmatt.com/msc/top.jpg[/img] [url]http://www.andersonmatt.com/[/url] --> If you wanna take a test drive.
Nice work Matt!
[QUOTE=Diaklu;17847257]Nice work Matt![/QUOTE] Thanks. :) I love PHP. :D [editline]03:31PM[/editline] Shit, I should add the user's links to this too. :D
Made my own mousetracker: [IMG]http://i35.tinypic.com/nvv4li.png[/IMG]
Will this be the revenge of the mousetrackers ? Anyways, i'm continuing some more on php and decided that i'l save my c++ career for later. Someone has a mousetracker for me ?
You can have mine if you want. [url]http://dl.getdropbox.com/u/1106779/MouseTracker.jar[/url]
Sorry, you need to Log In to post a reply to this thread.