Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. SELECT class, COUNT(0) AS num FROM Student GROUP BY class ORDER BY count(0) ASC
  2. why not just...copy()? Does the server disable remote url access?
  3. LIKE is an operator that allows for wild cards. You can find anything LIKE '%a%', which is anything with a lowercase A in it. It's not a magical "read this and figure out what's similar" function. You have "chester city." Even if you split that into WHERE field LIKE '%chester%' AND field LIKE '%city%' you'd still get Man U in there. Also, your query is fundamentally wrong, you can't just FROM table LIKE string
  4. The code you're given on a forum may just be an example, and not designed to be blindly copied and pasted into your application without any problems. If you'd like to blindly copy and paste without reading it and learning how it works, we have a freelancer forum where you can hire employees. 'someval' was used in that code to indicate some value, a value you need to provide.
  5. Unfortunately you're in a situation where literally everything is wrong. Sometimes, when you crash a car, it's easier to just buy a new one rather than fix the old one. Your car is totaled.
  6. What I said: Your include statement is missing a slash. ../Connections/qmbl.php What you said: I really want to focus on this area. Does the highlighted need the () I mean...REALLY? I said slash, you somehow got parentheses. Zend Studio is $300.
  7. Class variables are accessed with $this->type; Not just $type;
  8. everything we've discussed so far has been bugs. Your include statement is missing a slash. ../Connections/qmbl.php I can't tell if that's it though, this is WAY too much code and you're using a code generation product we've said is known to be bad.
  9. Did you, in any way, read the site on how to properly use sessions? Correct your session code. Fix your loop. Fix your concatenation line. We've specified 4 things that are wrong, even copying and pasting the lines and telling you why they're wrong. If you can't do this yourself, there's a freelancer board where you can pay someone to do it.
  10. What does what mean? The exact same error you keep having and we keep telling you how to fix? You don't have a favico or a robots file. Ignore those. Fix the PHP FATAL ERROR
  11. That's what I thought at first too, but look at the way he's doing it:$string.function(arg1, arg2); It looks like he's trying to chain the substr() function off the string object. WE think it's concatenation because we're well versed in PHP, but in 15 other languages that would be valid object-function access.
  12. No, I'm not rewriting your code. You don't even appear to realize you're using PHP. IS this PHP? Lines like this: $query=$sql.substr(0,$sql.strlen($sql)-9); That looks like you're trying to use C# or something. I said your loop is useless because it overwrites the value of $sql every time. Also, because $count isn't a number. Start debugging this. Print each variable every step of the way to see what it is. Why isn't it what you expect? Research the functions you're using and what they're supposed to do (as well as how to use them). Also, redesign your database so you don't have 500 tables with the exact same structure and name with numbers at the ends. If you ever do anything where you have tables or variables with sequential numbers at the end, you're doing it wrong.
  13. Yes, also, "stop using that site." Most of the content of this thread is good advice, not just Kicken (though Kicken is very smart)
  14. That error means your query failed and you didn't handle the errors. There's a number of things wrong with your queries. No spaces around UNION ALL, the loop is useless, you're using some potentially reserved keywords, and your database apparently gives root access to anyone.
  15. so you want the intersection of all 3 arrays, and any one or two of the three may be empty, and therefore you shouldn't use it? $args = array(); if ( !empty($arr1) ) $args[] = &$arr1; if ( !empty($arr2) ) $args[] = &$arr2; if ( !empty($arr3) ) $args[] = &$arr3; if ( count($args) == 1 ) { $new = $args[0]; } else { $new = call_user_func_array('array_intersect', $args); }
  16. Read the rest of the posts and click on the links to the session manual, for one.
  17. Web-safe fonts is a popular discussion topic. There's a comprehensive-looking list here, and sitepoint has a whole article about it. That font you used as an example is horribly kerned. Stick to normal fonts, or make images if you really need something to look like a signature or whatever.
  18. Where are you getting that? From what?
  19. mysq1_query is not a function. There are two possible explanations: 1) Someone once had a mysq1_query function, which you have somehow deleted. Very unlikely 2) Someone, through malice or ignorance, made a site-wide change that switched mysql and mysq1. This is probably what happened. Either way, find all instances of mysq1 and change them to mysql. That's the solution. There is no other.
  20. Right, you've just described a functioning array_intersect function. Step 2: What do you want instead of what you're doing? It was the part of Barand's question after "and" and before the question mark.
  21. You can't use COUNT() along with LIMIT, you have to use SQL_CALC_FOUND_ROWS, that's what it's for.
  22. Read the manual for array_intersect: It doesn't combine arrays, it's used to filter arrays. If you're combining arrays, you want array_merge. What you say you're doing doesn't match the function you're using, yet you say it's working. Answering Barand's question will help us figure out what you really want.
  23. SQL_CALC_FOUND_ROWS can also seriously slow down the query, since the entire data set needs to be parsed even if you're just looking for the first 10. Though this query is ordered, so it shouldn't have any effect on processing time.
  24. Yep, I do. Now ask a question that can be answered in less than 15 pages. What do you mean? What are you trying to do? Why are you trying to do it?
×
×
  • 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.