jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
SELECT j.name,COUNT(n.note) as comments FROM jobs j INNER JOIN notes n USING(jobID) ORDER BY n.noteID DESC !. Comments should contain 2 rows. Whenever, if you use count(*) the mysql will count all rows in the result set even the comment is NULL.
-
Describe both notes and jobs tables. You need to use only one query to accomplish this task.
-
Can anyone suggest what Errcode: 2 or [mysqli.query]: (HY000/6) is ?
jazzman1 replied to jason310771's topic in MySQL Help
Well, apparently Google doesn't know everything as I thought What I meant is to use php sorting the results. -
Can anyone suggest what Errcode: 2 or [mysqli.query]: (HY000/6) is ?
jazzman1 replied to jason310771's topic in MySQL Help
No, the file server doesn't touch the temp directories/files of any applications, only the apps deal with them. So, I'm not sure where the problem exactly is, but I would suggest you to start sorting the random results using the application server instead the database server. -
Does your host provider provides you a open SSL connection? You should post the script before ask for any help, you've given very little information about it.
-
Can anyone suggest what Errcode: 2 or [mysqli.query]: (HY000/6) is ?
jazzman1 replied to jason310771's topic in MySQL Help
Most likely your application script doing something wrong dealing with DB server. Are you able to show us some part(s) of the script on the main server? -
Can anyone suggest what Errcode: 2 or [mysqli.query]: (HY000/6) is ?
jazzman1 replied to jason310771's topic in MySQL Help
Yeap, I agree with kicken. Some database developers believe that sorting should be done in the application (file) server, not in the database and I think they have a very good point. Most often, the presence of an ORDER BY clause requires the database server to write/read the results into a temporary table like in your example and this temporary table is then read back and sorted. Did you call a delete statement somewhere in the script before the select one? Or....you're running multiple queries in loops? Start, telling us the whole story. -
What's wrong with my DB query (COUNT, UNION ALL, PDO)
jazzman1 replied to PHPBear's topic in PHP Coding Help
Take a look at mac_gyver's reply - http://forums.phpfreaks.com/topic/285170-delete-multiple-rows-with-pdo-and-checkboxes/ -
By the way, if you use COUNT() function with a column name like count(colname) as a single argument, mysql counts the rows only with non-null values and returns 0 (zero) if the value of the column is null. However, if you use count(*) mysql returns the total number of rows in the result set.
-
I was thinking that you're the owner or at least having an access to "dd.weatheroffice.gc.ca". Glob and directoryOperator works locally.
-
Maybe the e-mail client restricts you to post/submit data within a form. Did you try using JS?
-
You have to have knowledge of some database and its language, php or other server side language, probably Javascript a client side language and Ajax, HTML and CSS. It's simple
-
The doddsey_65's script should work for you b/s it works for me. Double-check the path to the target directory (use an absolute path for every case). It's my attempt using DirectoryIterator. <?php $dirTarget = 'directory/target/'; $searchTime = array(); $date = new DateTime(); $iterator = new DirectoryIterator($dirTarget); foreach ($iterator as $fileinfo) { if ($fileinfo->isFile()) { $searchTime[]=$fileinfo->getMTime().' '.$fileinfo->getFilename(); } } sort($searchTime,SORT_NUMERIC); $result = explode(" ",end($searchTime)); $date->setTimestamp($result[0]); echo "<pre>" . "Last modifided file is: ".$result[1]."\n". 'Date modified is:'.$date->format('Y-m-d H:i:s') . "\n". "</pre>";
-
Why don't you test the script provided by doddsey_65 rather than repeat the same question twice ??? As ginerjm stated you would use a glob() function. I think that the easiest way. Go to the source of php.net and take a look at examples. Make some effort trying to write the script yourself and if you got obstacles come back again.
-
and, if your database container is set the same as your intended character set in this case UTF-8, you don't have to force every time SET NAMES making the connection charset to whatever you specify. Instead using CHARACTER SET instead of SET NAMES. $conn = new PDO("mysql:host=$dbhost; dbname=$dbname;charset=utf8", $usernm, $dbpass);
-
What your definition of host is? You have 2 or multiple web host deployed on 1 physical machine (debian) or 2 web host deployed on 2 different machines?
-
No. If you have a string for example: /sc5/view/jazzman the service's engine should be redirect it to /sc5/view/index.php?i=jazzman. That's all and pretty simple. PS: Does a sc5 directory is a subdirectory of root one or is a subdir of another directory in the server? Describe the server structure.
-
Where is the dolar sign in second example? Try, "^/?sc5/view/(.*)$" => "/sc5/view/index.php?i=$1"
-
I guess, he's trying to return the value of the month without leading zeros. Something like: <?php date_default_timezone_set('UTC'); echo date("n"); //not echo date("m"); EDIT: Ah....now I see this, after I've posted my first reply
-
Update 01-09 to 1-9 in your case statement.
-
Can we see the updated script at this moment? Have you checked for actual errors using error_reporting php functions?
-
I tried Pierre, but....it contains over 200 lines of code without any comments itself. How would I do that? You state that the sql is working 100%, which is fine. However, I would say that only you have understanding on it as general. Again, your script is not readable. A loop inside other loop inside other one and so forth it is very hard to read and to get a logic. Never ever run queries in loop(s). It’s so easy to start hammering the database with crazy numbers of sql requests. Break down your script into small pieces. Use includes, classes, functions or whatever you want to keep it nice and clean. 243 lines of php (logic) and sql code on same document means you need to redesign it.
-
Start to redesign your script Pierre. You're looping and sending same query 38 times to DB. Inside this for operator you have a nested while operator and again you're selecting and inserting SQL codes to DB - that's no nice and it's very hard for anybody to read, understand and finally to provide a help on this issue. jazz.
-
@victormenezes, I don't like the idea to download files on my machine. It's a part of my self-discipline - nothing personally against you. I'm going to cite ginerjm!
-
Not sure b/s it's a part of template system, but try to get rid of backslashes "\" from the second line.