ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
SELECT class, COUNT(0) AS num FROM Student GROUP BY class ORDER BY count(0) ASC
-
How To Save Image From Web (Remote Image) Using Fsockopen()
ManiacDan replied to shilpa505's topic in PHP Coding Help
why not just...copy()? Does the server disable remote url access? -
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
-
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.
-
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.
-
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.
-
Class variables are accessed with $this->type; Not just $type;
-
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.
-
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.
-
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
-
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.
-
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.
-
Yes, also, "stop using that site." Most of the content of this thread is good advice, not just Kicken (though Kicken is very smart)
-
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.
-
Dynamically Combine Arrays With Array_Intersect()
ManiacDan replied to cyberRobot's topic in PHP Coding Help
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); } -
Read the rest of the posts and click on the links to the session manual, for one.
-
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.
-
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.
-
Dynamically Combine Arrays With Array_Intersect()
ManiacDan replied to cyberRobot's topic in PHP Coding Help
better yet: empty() -
Dynamically Combine Arrays With Array_Intersect()
ManiacDan replied to cyberRobot's topic in PHP Coding Help
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. -
Count Number Of Words In Output And Display "..." Link If To Many Words
ManiacDan replied to elite311's topic in MySQL Help
You can't use COUNT() along with LIMIT, you have to use SQL_CALC_FOUND_ROWS, that's what it's for. -
Dynamically Combine Arrays With Array_Intersect()
ManiacDan replied to cyberRobot's topic in PHP Coding Help
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. -
Count Number Of Words In Output And Display "..." Link If To Many Words
ManiacDan replied to elite311's topic in MySQL Help
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. -
Creat Php Api To Acess Remote Functions
ManiacDan replied to jason213123's topic in Third Party Scripts
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?