Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About jacquesvds

  • Rank
  1. You are right, it was a connection problem. Sorry for the trouble and thank you for simplifying the code . I learned something.
  2. Here is the code: $result = mysqli_query($donnees,"SELECT DAYOFYEAR(CURDATE()) as dayno"); $row = mysqli_fetch_assoc($result); echo round($pop / $row['dayno']); I use sql as I do not know any other way to program this. The whole app is written in PHP 5,8 and databases are mysql.
  3. Thank you. I applied your code and got INF as a result of echo round($pop / $row['dayno']); ? This is real weird. Sorry for the code writing.. I am just an autodidact amateur trying to assist an NGO in running their app . Further, I do not charge anything for this volunteer work. Thanks.
  4. The query works very well on its own but the script returns a no result...
  5. Thank you very much Barand. I run on PHP 5,6 in procedural style and I do not know whether I can mix your proposed PDO in my script. $resdays=mysqli_query($donnees,$sqlresdays) or trigger)_error("Query failed: ".mysqli_error($donnees); appears to be faulty ... Thank you for trying
  6. $sqlresdays="SELECT DATEDIFF(CURDATE(),MAKEDATE(YEAR(CURDATE()),1)) AS date_difference"; $resdays=mysqli_query($donnees,$sqlresdays); $daysinyr=mysqli_fetch_object($resdays); $divider = $daysinyr->date_difference; echo $divider; $finalpop=intval($pop/$divider); The above is the complete code. I actually try to divide the $pop (containing a big number) by the number of days in the actual calendar year.
  7. $sqlresdays="SELECT DATEDIFF(CURDATE(),MAKEDATE(YEAR(CURDATE()),1)) AS date_difference"; $resdays=mysqli_query($donnees,$sqlresdays); $daysinyr=mysqli_fetch_object($resdays); $divider = $daysinyr->date_difference; When running the sql request raw, no problem, date_difference shows the right number but in the script nothing is echo'd. Thanks for clues on how to resolve this.
  • 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.