amites
Members-
Posts
248 -
Joined
-
Last visited
Never
Everything posted by amites
-
[SOLVED] Paginated query with left join - trouble getting order
amites replied to amites's topic in MySQL Help
when I run the query with the ORDER BY I get an error question is, how can I order the results? -
[SOLVED] Paginated query with left join - trouble getting order
amites replied to amites's topic in MySQL Help
suppose I could simplify this by working with a single query, $query = "SELECT u.id AS user_id, u.username AS name, Count(l.id) AS cnt FROM bil_users AS u Left Join bil_msg_look AS l ON l.userid = u.id GROUP BY u.id LIMIT 0, 20" trouble is that if I make it look like: $query = "SELECT u.id AS user_id, u.username AS name, Count(l.id) AS cnt FROM bil_users AS u Left Join bil_msg_look AS l ON l.userid = u.id GROUP BY u.id LIMIT 0, 20 ORDER BY name ASC" then I get 0 results, so the question becomes: How can I run this query to get results in the same order each time it runs (I don't care how they are ordered)?? -
try assigning count to an individual field, otherwise no telling what it's going to be counting
-
I've gotten really bad about altering tables through PHP, if your just looking to get it done you could use PHP My Admin, if you're looking to learn sorry I can't help
-
which is faster ?? 2 Selects for 1 For Select with 2 rows
amites replied to isaac_cm's topic in MySQL Help
try it both ways and include a print out of how long the query took to execute run it a few dozen times each way and walah -
there a ways to do this, couple of classes I've seen floating around (can't remember any off the top of my head) however it violates some of the rules of web architecture (bad thing) so I haven't played with it, generally what I do is a follow-up page, give a happy note and a 2nd post button of course if your working with a small site you can always dig through the web to find methods, Google is full of great answers to good questions (the good question is the tricky part)
-
only way I've come up with to work with AJAX and sessions gets a little complex, the idea being post the SESSION ID to the page (run it through an encryption engine of some sort) and then call the session ID and load the values simple concept tedious implementation, if anyone else has a better way I'd love to hear it, as I've been tinkering with ways to implement this for a while
-
http://www.google.com/search?q=phpmailer+gmail&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
-
you could store the main page in the server cache, either in memory for getting really optimized, or in a pre-rendered version of the file which would be re-created when the admin changes the message make sense?
-
you need to set the user name and password for your database, those initial set of values look like they came with the default configuration, if that doesn't do it try looking to the PHP Fusion help board as you are using specialty software and this forum is geared towards people that want to learn rather than a quick fix
-
Hello, been a little while since I stopped by here, the new site looks great, anyway on to my question, I built a query that uses a dynamic left join to gather 3 sets of data from the same table, the data it's pulling is a list of users who have made posts in a contact system the trouble I'm having is that I made the query paginate the results, and when it gets from page 2 to page 3 the entries begin repeating, I tried using order by which ended up with 0 results, any ideas? $query = "SELECT u.id AS user_id, u.username AS name, Count(l.id) AS cnt FROM bil_users AS u Left Join bil_msg_look AS l ON l.userid = u.id"; if ($active == 1) { $query .= "\nAND l.active = '$active'"; if ($read >= 1) { $query .= "\nAND l.has_results >= '1'"; } } if (isset($limit_end) && intval( $limit_end) > 2007) { $query .= "\nAND l.created BETWEEN '$limit_begin' AND '$limit_end'"; } // original attempt to calm query, works with repeats after the first few pages $query .= "\nGROUP BY u.id" // pagination ." LIMIT $limit_bg, $limit_end";
-
get rid of the comma after content10
-
what I have is a function to perform a query inside a pagination, what I want to return is the number of rows and the results, thinking of taking it lazily and making the query for all rows to get the total number a separate function, but I'd like to get it all in at once
-
as in upload the file to your server instead of emailing it? try hitting google for "php upload file" should give you some good pointers to get started, not too complicated
-
Think I need to take a break, having trouble coming up with how to combine a set of mySQL results with a integer variable to be sent back from a function any suggestions?
-
huh? please think through your question, I don't think there are any mind readers on this forum
-
that code is a small piece of a much larger group of files, no way to know what is going wrong without looking at the various functions going on if you wrote this yourself then feel free to post up some more chunks, if you are getting this from another source then you will have more luck asking the author for help, or hiring someone to clean it up for you
-
are you typing in the full link HTML or just the URL? seems to want just the URL, could also have something to do with the <? vs <?php <? does not execute PHP unless told to specifically on the server
-
yup, mySQL is smart
-
can't remember off the top of my head, it's the same mos command used to load the module location you want to affect something like mosLoadMod ( 'right' ) {this is not correct but it's close} check your template index.php for the specific line, if you need help getting it done send me a PM and I can alter the template, have to charge a little for the time though
-
line 2??
-
something along the lines of UPDATE table SET field = field + INTERVAL X HOUR
-
have you tried addslashes? works much the same way as mysql_real_escape_string if this is part of a larger CMS and they did not create it to handle quotes then there is something rather wrong with that CMS
-
are you escaping the quotes with \ as in here is \"My Title\" - tadaa
-
make sure you get your date into a YYYY-MM-DD format = $date then add a WHERE statement to your query WHERE date_field BETWEEN $date AND now() should work, depending on your DB structure