• What are you working on? V4 (HTML ISN'T PROGRAMMING)
    2,003 replies, posted
[QUOTE=a2h;17837624]I mentioned every time before I'm using an external MySQL database.[/QUOTE] 43 queries
[QUOTE=gngbng;17838050]43 queries[/QUOTE] You along with others are quite welcome to improve on my code when I put it up on GitHub; I'm not going to say I'm a very experienced programmer because that's not what I am. In any case, I think it's time I moved the script to a place where it'll be using a local database.
[QUOTE=a2h;17838075]You along with others are quite welcome to improve on my code when I put it up on GitHub[/QUOTE] How soon will that be? Are you going to wait until it's completely finished or will you upload a WIP? I would like to contribute.
[QUOTE=ltkerr0r;17838627]How soon will that be? Are you going to wait until it's completely finished or will you upload a WIP? I would like to contribute.[/QUOTE] When I implement managing projects and categories, I'll do a little bit more testing before I put the code up. However, as you can see, I've been all over the place in what I've been working on, but I'll hopefully try and prioritise them.
[img]http://www.cubeupload.com/files/915800barpic.png[/img] Some art for the club/bar for the rpg I posted in the last thread, properly dubbed pixel bitches.
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=Maurice;17839318]I made a program which tells me where I have my mouse the most. [img]http://filesmelt.com/downloader/mousefollower.png[/img] It's pretty random, except I have my mouse more on the left side of the screen.[/QUOTE] Haha that is pretty cool
[QUOTE=efeX;17837838]learn to read[/QUOTE] i'm sorry, but doesn't that say [b]43[/b] queries? Please explain why it needs that many.
[QUOTE=Maurice;17839318]I made a program which tells me where I have my mouse the most. pic (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) pic[/QUOTE] I smell Chrome! Or not... Also, release?
[QUOTE=SteveUK;17841088]i'm sorry, but doesn't that say [b]43[/b] queries? Please explain why it needs that many.[/QUOTE] Because [QUOTE=a2h;17838075]You along with others are quite welcome to improve on my code when I put it up on GitHub; I'm not going to say I'm a very experienced programmer because that's not what I am.[/QUOTE] --- In other news, I've replaced instances of mysql_real_escape_string in my code with a function that ensures things like \\\' don't happen (resulting in \'), brilliant.
[QUOTE=SteveUK;17841088]i'm sorry, but doesn't that say [b]43[/b] queries? Please explain why it needs that many.[/QUOTE] efeX trolls everyone and jumps on bandwagons, look at the whole "OMG YOU USED A TUTORIAL!11!!!1" shit he has against me.
how is that jumping on a bandwagon if I was the first person to accuse and prove that you did it?
43 queries - pah. I *think* on the homepage of [url]http://welovebrew.kerplunc.com/[/url] I'm using way more. One to get each "type" of event, then one or two within each event (the 10 listed, might be more) to get user info or brew info or company info. Is there any way I can combine some of that shit with more advanced MySQL queries? I've tried but nothing I've found worked properly.
[QUOTE=efeX;17841319]how is that jumping on a bandwagon if I was the first person to accuse and prove that you did it?[/QUOTE] Wow, sorry I never actually learnt how to program with C++, therefore requiring a tutorial :rolleye:
[QUOTE=Blynx6;17841391]Wow, sorry I never actually learnt how to program with C++, therefore requiring a tutorial :rolleye:[/QUOTE] There's a difference between using a tutorial to learn and using a tutorial to copy and call your own. :rolleye: :rolleye: :rolleye:
[QUOTE=efeX;17841405]There's a difference between using a tutorial to learn and using a tutorial to copy and call your own. :rolleye: :rolleye: :rolleye:[/QUOTE] Meh, drop it. I've stopped programming C++ because I'm too lazy to install the IDE. So don't expect that anymore. [editline]08:44PM[/editline] Sure, rate me dumb. Like I give a shit about a couple of icons.
Hey, you don't need an IDE to program in C++ :downs: Anyways, dropped.
[QUOTE=efeX;17841458]Hey, you don't need an IDE to program in C++ :downs: Anyways, dropped.[/QUOTE] You still need a compiler :v: Cheers.
[QUOTE=PoliticalM;17841337]43 queries - pah. I *think* on the homepage of [url]http://welovebrew.kerplunc.com/[/url] I'm using way more. One to get each "type" of event, then one or two within each event (the 10 listed, might be more) to get user info or brew info or company info. Is there any way I can combine some of that shit with more advanced MySQL queries? I've tried but nothing I've found worked properly.[/QUOTE] Why don't you use one query to get all the types of event? (though I don't see why you'd store event types in SQL) oh, and [url]http://www.w3schools.com/SQl/sql_join_inner.asp[/url]
Anyway, what am I working on now? Well since i finished my steam page image: [img]http://blynx.org/projects/steam/steam.php?id=BlynxSR[/img] I've decided to follow someone in this thread ( Can't remember who ) and create an isometric game, whilst theirs it made in Java (?), mine shall be made in PHP. This will most likely fail hehe.
[QUOTE=Blynx6;17841515]Anyway, what am I working on now? Well since i finished my steam page image: [img]http://blynx.org/projects/steam/steam.php?id=BlynxSR[/img] I've decided to follow someone in this thread ( Can't remember who ) and create an isometric game, whilst theirs it made in Java (?), mine shall be made in PHP. This will most likely fail hehe.[/QUOTE] Yes since PHP isn't at all designed for real time games. Something like Ogame? Fine. Graphics? No.
[QUOTE=SteveUK;17841481]Why don't you use one query to get all the types of event? (though I don't see why you'd store event types in SQL) oh, and [url]http://www.w3schools.com/SQl/sql_join_inner.asp[/url][/QUOTE] Thanks for the link. Also, the events aren't events, it's grabbing them direct from all the comments, brews, etc tables. Every comment/additional brew/etc has a 'time' field, and so it grabs the last 10 from each and orders them by time. I would prefer to grab everything from multiple tables, but so each row was correct to its original, and all the missing info was just blank, if you get me. Anyway, left join should cut down on half if not more of the queries, and ofc such a homepage will be cached.
[QUOTE=SteveUK;17841519]Yes since PHP isn't at all designed for real time games. Something like Ogame? Fine. Graphics? No.[/QUOTE] Didn't plan for it to be realtime.
43 queries is a lot. It is. Unless you have about 200 tables in your database. Saying "oh I'll upload the code and you can improve it" isn't really helping you learn anything about where you're going wrong. I suspect that you're doing it like this.. query amount of results for each result query full result information end when you should be doing query results for each result do stuff with result (NOT QUERY) end You see, the first one queries for each result - which is INSANE. The second one queries ONCE. If this is the problem just say and we can teach you how to do it properly..
[QUOTE=garry;17841550]43 queries is a lot. It is. Unless you have about 200 tables in your database. Saying "oh I'll upload the code and you can improve it" isn't really helping you learn anything about where you're going wrong. I suspect that you're doing it like this.. query amount of results for each result query full result information end when you should be doing query results for each result do stuff with result (NOT QUERY) end You see, the first one queries for each result - which is INSANE. The second one queries ONCE. If this is the problem just say and we can teach you how to do it properly..[/QUOTE] I expect the former. But I assume he's doing a lot more than 1 query. And for each result: +1 query for project name +1 query for comment count (you should cache this in the table for the bug report) +2 queries for username information (creator and last reply) and possibly +1 for bug category
[QUOTE=Eleventeen;17831765]Yes, but now my iconic post is on the first page![/QUOTE] And everybody hates you for it. Good job. :buddy:
[quote=garry;17841550]43 queries is a lot. It is. Unless you have about 200 tables in your database.[/quote] Which of course, isn't the case, you're right. [quote=garry;17841550]Saying "oh I'll upload the code and you can improve it" isn't really helping you learn anything about where you're going wrong. [/quote] I don't think what I originally said reflected my actual intentions at all. I know of "LEFT JOIN" and such commands, but I haven't bothered to learn them. I do plan on doing so and improving on much of the code myself. [quote=garry;17841550]I suspect that you're doing it like this.. query amount of results for each result query full result information end when you should be doing query results for each result do stuff with result (NOT QUERY) end You see, the first one queries for each result - which is INSANE. The second one queries ONCE. If this is the problem just say and we can teach you how to do it properly..[/quote] I'm not sure about how to interpret that, so I'll just throw the code up onto GitHub. [url=http://gist.github.com/210871]Here[/url]. As you can see it's got a lot of queries, yes, most of them unnecessary which should be replaced with JOINs.
Yep, queries inside loops = bad. You should do everything you can to avoid it.
Youtube video.
[code]$result_issues = db_query( "SELECT * FROM issues LEFT JOIN (SELECT * FROM comments ORDER BY when_posted DESC LIMIT 1) AS comments ON issues.id=comments.issue ORDER BY issues.when_opened DESC" );[/code] :psyduck: And I haven't even tried to find a way to order by comment if it exists otherwise when the issue was opened.
Sorry, you need to Log In to post a reply to this thread.