Jump to content

Paul-D

Members
  • Posts

    156
  • Joined

  • Last visited

Everything posted by Paul-D

  1. Okay thanks. I am the sole user of this and the table is relativly tiny. Holds all the euros from Feb 2004. Thanks though.
  2. function GetAllData() { $pdo = connectDB(); $sqlLottoList = "SELECT * FROM EuroMillions ORDER BY Draw DESC"; $stmt = $pdo->prepare($sqlLottoList); $stmt->execute(); $stmt->fetch(); echo $stmt['N1']; // Test line 22 exit; return $stmt; } Fatal error: Uncaught Error: Cannot use object of type PDOStatement as array in /vhost/d/e/s/desmond-otoole.co.uk/www/Lottery2/secure/LotteryFunctionsPDO.php:22 Should return tinyint(1) value 16 /* first row in table. */
  3. Thanks gizmola
  4. I only put BST to show what it represented. I have inspected the code and got this... Don't know where I am supposed to be lookimg.
  5. Canm you tell me how I do this... you can look at the response headers in the browser's developer tools Also I have added HTML to the test page to invoke no cashing. Can someone check this also. I have set it to a 10 second refresh... <?php error_reporting(E_ALL); ini_set('display_errors', '1'); date_default_timezone_set('Europe/London'); $t_stamp = time(); $Nice = date("d-M-Y H:i:s",$t_stamp); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Date Test</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="imagetoolbar" CONTENT="no"> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="0"> <meta http-equiv="refresh" content="10"> <link rel="stylesheet" href="stylesheets/Library.css" type="text/css"> <link rel="stylesheet" href="stylesheets/LibraryMenu.css" type="text/css"> </head> <body> <H2>This is done with no browser cashing.</H2> Today is <?=$Nice;?> BST. </body> </html> Also. I lot's of websites have a timeout forcing people to log in again. How can this be done if it is cashed or is it done another way? I do it by refreshing and getting the time. They also said the coding being used would need to be set up to bypass the caching. and I am doing this.
  6. Can someone help me with a reply from easyspace as it is confusing. [disabling varnish caching] "Our senior administration team have reviewed the server/time issue as requested. They have advised that the issue is a caching problem and that the coding being used would need to be set up to bypass the caching. Alternatively, they have suggested disabling varnish caching for further testing. This can be done by our technical team if you wish to test this."
  7. Well spotted. have changed it to echo date("d-M-Y H:i:s",$t_stamp); . It is still wrong. It stalls. Easyspace kow there is a problem. I am paying good money for a rubbish service. Also noticed when I use my mobile phone it is difrent again. http://desmond-otoole.co.uk/testdate.php
  8. Just spoke to easyspace and am told that the server I am on has randome times. Has anyone heard of this bisare setup. We rely on that time when entering information into a database.
  9. I pay a company easyspace to host my website I am now getting 03-Jun-2024 15:15 when it is 15:47 it was 45 minutes out now it is 32 minutes ahead. It is random. 3 minutes later it still shows 15:15 It's not the code is it? Looks fine to me. Just want to make sure before I contact them. Don't understand NTP service but this is a home computer and my windows clock is correct. Is it wrong with you?
  10. Just check this again and the hours minutes seems to be random. I was upgraded to php8 http://desmond-otoole.co.uk/ver.php
  11. http://desmond-otoole.co.uk/testdate.php Can someone check this for me (UK) <?php error_reporting(E_ALL); ini_set('display_errors', '1'); date_default_timezone_set('Europe/London'); $t_stamp = time(); echo date("d-M-Y H:s",$t_stamp); exit; ?> I am getting 03-Jun-2024 14:29 when the time is 15:04
  12. As for $_SESSION['Survalance']. This was a typo. I copied it across. and changed the name of the session. As for a session ending. If I set up a session at the start of the website log on. and do nothing for over 1/2 hour, the session naturaly expires on the server. I was thinking that every refresh would cause session_start() to refresh the session timeout on the server keeping the values and it could go for hours/days. That way I would not be worried about the session expiring. I am the only user of the website, but I would also assume on multi-user that each user would have their own session stored on the server. I was hoping that my sessions on the server would stay active. It's a kind of catch all with the refresh. One of the variables has a date and time after which I would be redirected to the log on page regardless of the natural expiry of the session on the server.
  13. Hi. I think this has been solved now. I have moved the if (!isset($_SESSION['Survalance'])) $_SESSION['Survalance'] = ''; to Statment.php and I have modified the function GetAllData($StartDate, $View) So now $View is passed so ther should be not problems. It seems to be wotking so I wiil test it. As a question, does session_start() reset the timeout period for all sessions? Does updating a session variable also reset this? Thanks for your help. This code was written nearly 10 years ago.
  14. Not sure if this is the right section as it is PDO. I used to use mySQL. This website section has worked for nearly 10 years without fail. Early this year my website host upgraded the PHP server and as a result I had to move from mySQL queries to PDO queries. This web page refreshes every 2 minutes and after a while takes you back to log on again. After one of the refreshes’, I get an error shown in this image [BankSite-1.jpg]. I know where the error is: GetAllData(). This does not happen at every refresh I have a separate secure functions file SecureFunctionsBankPDO.php. There are 2 SQLs in a function GetAllData() it depending on how I log in. It is the first SQL at line 62-65 that is causing the problem. It gets its only parameter $StartDate from the webpage which is being refreshed evert two minutes. It is set on line 29 of the webpage Statement.php and called on line 109. As this is worked each refresh, I can’t see how the variable is getting lost. If I have missed a file then tell me. I think it is all you need. Thanks. Topic should have said PDO error on function since a migration to PDO My keyboards fault. SecureFunctionsBankPDO.txt Statement.txt
  15. Thanks for that I didn't correct a <?php. PHP 8 is very strickt and takes no prisoners. I w will have to go through the rest of my code with a fine tooth comb. Thanks for your help.
  16. That didn/t work it gave me another error Parse error: syntax error, unexpected token "?" in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/StatementEntry.php on line 113 Probably because the ending bracket was moved away from the ? SELECTED <?php }? >
  17. Well I have done exactly as you sugest but this is still not happy. The problem is around a <select> </select> on lines 111 to 123 Error: Parse error: Unclosed '{' on line 122 in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/StatementEntry.php on line 191. I can not see any issues as there is definatly spaces here. There is .htaccess with the lines php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on phpTest.txt
  18. Well thanks to Barrand. Leaving spaces after <?php and before ?> has made a diffrence. I have never done that before. Is this NEW to PHP8 or has it always supposed to be that way? Love to know!
  19. One question is, if i put an exit; on line 4 why do I not get an ! am here message only?
  20. Error on page is Parse error: Unclosed '{' on line 183 in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/DataInput.php on line 23
  21. As an addition, they changed my .htaccess to php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on
  22. I have had majour problems with my easyspace website. I beleive the servers were not updating over the weekend. I am now told that the reason for the error is on a line that should not be reached. I put a hello world and an exit at the verry top of the code. Can soneone tell me what is wrong with line 183 please [<?php if($MM > '10') {?>] After I spoke to them this morning the page says Parse error: Unclosed '{' on line 183 in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/DataInput.php on line 236 But there is no line 236. Test.txt
  23. Well thanks for all that. I thought ther was a problem with that function but it worked fine under PHP 5.4 for some strange reason. THings are looking up now. Thanks also to kicken. I have only used <?php at the beginning of a file but stand correctedd now.
  24. Thanks for all your help. I have managed to isolate the function with the problem. The problem is I can't figure a way out of it. I have a database table of futuristic entries into an look ahead statment. What I want to do is display an online bank statment where the start date is given to a function and I want the querie to create a data set from tthat date to six weeks in advance. Can someone help me out with this query. What is strange here is this all worked fine for tebn years untill my provider updated the server from PHP 5.4 to PHP8. So the SQL will probably need to change. function GetAllData($StartDate) { $pdo = connectDB(); $sqlAllData = "SELECT * FROM Bank_Data WHERE EntryDate > :StartDate AND EntryDate <= DATE_ADD(:StartDate, INTERVAL 6 WEEK) ORDER BY EntryDate ASC, Output"; $stmt = $pdo->prepare($sqlAllData); $stmt->execute(['StartDate' => $StartDate]); return $stmt; } Error Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/secure/SecureFunctionsBankPDO.php:39 Stack trace: #0 /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/secure/SecureFunctionsBankPDO.php(39): PDOStatement->execute() #1 /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/Statement.php(104): GetAllData() #2 {main} thrown in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/secure/SecureFunctionsBankPDO.php on line 39
  25. Well that is new to me. I have only used <?php at the start of a page and under php 5.4 it worked fine for over 10 years. Maybe this is more strickt in PHP 8. It did work fine for over 10 years. FACT. I will go through all my files tomorrow and let you know the outcome.
×
×
  • 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.