Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. MySQL TIME format is HHH:MM:SS, so how do you divide that by a number and expect a sane result with colons in there?
  2. Also $domainName=$row[DOMAINS]; 1) in your query you are retrieving "domains" (lowercase) 2) It should be $row['domains'], with quotes around the array index. Further, your <option> is wrong. The format should be: <option value="this-is-the-value-submitted-with-the-form">Text that is displayed in the dropdown</option>
  3. I don't see anywhere that you are using $i, so what's it supposed to be doing? But yes it's hard to increment a value ($i++) if it doesn't initially have a value, so what's it supposed to increment? Maybe $i = 0; just before the loop but I still don't know what you're doing with it or if it's even needed. It could be because of the X/Y coordinates where you are inserting the text within the loop. The coordinates never change so it will just write over itself for each entry. Probably the $pdf->SetY(35); where 35 should be incrementing by some number each time it goes through the loop so each entry will be placed on its own line.
  4. Something like that. Does it display in the PDF like you want? I'm not sure if you want this part repeating: $pdf->SetFillColor(192,192,192); $pdf->SetFont('Arial','B',10); $pdf->SetY(35); $pdf->SetX(25); $pdf->Cell(50,6,'Site',1,0,'C',1); $pdf->Cell(50,6,'Number of faults',1,0,'C',1); If not maybe that one should go before the while() loop. It looks like it might be a header containing "Site" and "Number of faults" so probably only want to output it once while the data repeats in the loop below it.
  5. It's because of these lines: while($row = mysqli_fetch_array($result_topten)) { $site = $row['site']; $num_faults = $row['count']; } Think logically about what's going on here. You are rewriting/overwriting $site and $num_faults each time the loop runs. So at the end of the loop execution, $site and $num_faults will be the very last values they encountered of the result set. So you need to add the code that is adding those values to the pdf to be within that while() loop instead of after, so that each one gets added.
  6. My guess is most people on this forum have never used that plugin. You might have better luck posting your question here: https://wordpress.org/support/plugin/woocommerce
  7. But the first IN condition is getting posts with year > 2013, while the 2nd in might have dates pre 2013. Maybe not in reality, but could.
  8. Hope it's not a dynamic IP (which changes). Otherwise you'll have to be updating your code constantly. I think a log in system would be much better with permissions/user levels. If 'administrator' logs in, run script A, if 'maintainer' logs in, run script B, etc.
  9. You can always run it from a script and when it's complete email it somewhere or whatever you need to have it do. You can also just do it from a cronjob like this.
  10. Just a guess here, but are you sure the file is located in the sysplugins dir? Your testInstall() indicates the dir is named "sysplugin".
  11. It seems if you want to "count" it, you could just use CURL like this to only examine the file header and if the status returned is 200 than increment a counter or something.
  12. You really shouldn't keep adding to an issue after you mark it as solved. Most people won't read it if it has the big green ANSWERED tag in the title.
  13. It's probably slow because it's on a remote server, which means it has to retrieve the file first before it can run a function on it.
  14. jpeg's don't do transparency. Use PNG as mentioned above.
  15. Why do you NEED php to output that pure JS that doesn't even contain any PHP? It is totally unnecessary. Just put it in regular HTML in the HEAD of your document. You also have an extra <script> tag within a <script> tag and an extra } You also aren't using window.location correctly if you want to redirect. What's the replace doing? Nothing. <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> function redirect() { window.location = "http://www.something.com/"; } </script> </head> <body> <button onclick="redirect()">Redirect</button> </body>
  16. What error are you getting? It seems it would be best to add a new column to your db's user table and hold the script name that you want that user to redirect to. Then when the user logs in redirect them to that page instead of in an if/else block. In your else statement above, you have a misplaced quote in the echo statement (no space between echo and first quote)
  17. For one thing, their JS files (with a js extension), so php won't parse them (unless you set your server up to parse js as php)...meaning you can't have php directly in the js file.
  18. And I would urge you to use PDO, or MySQLi instead of the MySQL extension. The MySQL extension has been deprecated and will be removed from PHP soon, so you'd have to rewrite everything. Might as well learn it now and become a bit more future-proof
  19. You probably want 'password' to be '$password' too (has nothing to do with your code showing) $query = mysql_query("select * from login where password = 'password' AND username = '$username'", $connection);
  20. There was nothing (visible) in your code that actually called repostEndSelect(), so it doesn't get executed. If you had a page that only had: <?php echo 'outside function<br>'; function repostEndSelect() { echo 'inside function'; } and ran it, you would only see "outside function" as the output. If you had <?php echo 'outside function<br>'; function repostEndSelect() { echo 'inside function'; } repostEndSelect(); //calls your function to execute it Then the output would be: outside function inside function
  21. Where is $this->row and $this->rowset being defined? Regardless, $this->query_result wouldn't be an array index of either of those, it's a result. You should probably also check to see if those are isset() before trying to unset() them.
  22. @ginergm, looks like he's using bootstrap, which is how they do it... http://getbootstrap.com/css/#forms
  23. Hard to tell since that wasn't in your original code. Please post your most recent code.
  24. There are 2 types of mysqli functions, one for procedural coding, which you are using, and the other for OOP. See the example in the manual for procedural style. This doesn't have to do with your error, but this is also incorrect as it's using mysql function and not mysqli equivalent. $this->db_connect_id = mysql_pconnect($this->server, $this->user, $this->password);
×
×
  • 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.