User Profile

Collapse

Profile Sidebar

Collapse
neelsfer
neelsfer
Last Activity: Aug 22 '17, 08:52 PM
Joined: Oct 1 '10
Location: Queenstown
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • neelsfer
    started a topic PHP sql Subtract two dateTime fields to a millisec
    in PHP

    PHP sql Subtract two dateTime fields to a millisec

    I have two fields in a sql query for a html table that needs to be subtracted. The datetime format looks like this "19/08/2017 23:32:08.580"
    My sql with inner joins looks like this
    Code:
    $query = "SELECT tblentries.categories,tblracedetails.actual_start_time,tblentries.age,tblentries.firstname,tblentries.surname,tblentries.distance,tblentries.raceid,tblracetime.finishtime,tblracetime.raceno,tblentries.racedate,tblentries.racename,TIMEDIFF('tblracetime.finishtime','tblracedetails.actual_start_time')
    ...
    See more | Go to post

  • I seem to have fixed it by adding "e.preventDefau lt();" below button click. Hope this code helps somebody else also
    See more | Go to post

    Leave a comment:


  • neelsfer
    started a topic Ajax onclick button not populating a textbox

    Ajax onclick button not populating a textbox

    I have this Ajax with PHP that determines my value correctly from a php sql query, on my "test page".

    When adding the code to my main page, the button adds the correct data for a half second, and then removes it, leaving the "categories " input textbox empty.

    The rest of the page is populated onload from local storage, before i press this button to populate the "categories " textbox. Any suggestions...
    See more | Go to post

  • neelsfer
    replied to Json encode UTF-8 error
    in PHP
    Anybody else with this issue - I got a fix on google like this
    Code:
    <?php
    $con = mysqli_connect("localhost","root","","registerdb");
    
    // Check connection
    if (mysqli_connect_errno())
      {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
      }
      mysqli_set_charset($con,"utf8");
    ?>
    See more | Go to post

    Leave a comment:


  • neelsfer
    started a topic Json encode UTF-8 error
    in PHP

    Json encode UTF-8 error

    I get this JSON create file error called : "Malformed UTF-8 characters, possibly incorrectly encoded", if i try and make a file consisting of about 40 000 records.This happens at record 16669. If i limit the records to less than 16668, it is correct.The record in question is correct, i checked.
    Any suggestions please?
    Code:
    <?php 
    function get_data()
    {
    $connect = mysqli_connect("localhost","root","","registerdb");
    ...
    See more | Go to post

  • Thx for comment. It is for a cycling races online registration site. I don't expect to many 101 year old cyclist's to enter.
    See more | Go to post

    Leave a comment:


  • After 3 hours of struggling, i got it working. Anybody else needing a very basic solution, here it is
    Code:
     <body>
    	<form>
    		<input type="text" name="idno" id="idno" value="" placeholder="ID Number" onkeyup="dateOfBirthsum();" />
    		
    		<input type="text" name="dob2" id="dob2"  placeholder="birthdate2"/>
    ...
    See more | Go to post

    Leave a comment:


  • Needs dd/mm/yyyy birthdate format from a string in javascript

    I need to change a South African ID number to the date of birth (DOB)dd/mm/yyyy using javascript
    example of ID Number - 0203185149088.
    My code gives it as 18/03/02 instead of 18/03/2002 and if ID No is 6202185155087 then i get 18/02/62 and not 18/02/1962
    The years before 2000 and after needs to be added please
    dd/mm/yyyy
    Please assist
    Code:
    	<form>
    		<input type="text" name="idno"
    ...
    See more | Go to post

  • How to populate php multicolumn dropdown box to textboxes using Js

    I have a multi-column dropdown box using PHP and MYSQLI from the racedetails table that populates from DB.

    I need to dynamically populate the fields in a row from the dropdown box, to respective text boxes on the form, after selecting the correct row using javascript i assume. More data will then be added to other text boxes on form, before the database is updated with a submit button.
    racedate,
    racename,
    distance,...
    See more | Go to post
    Last edited by neelsfer; Dec 27 '16, 06:13 PM. Reason: fixed field names

  • I suppose all the code needs to be rewritten from PHP to Javascript? One cannot only adjust it?
    See more | Go to post

    Leave a comment:


  • Convert ID Number to Birthdate, gender and age as of 31/12 of current yr

    I am a new, "trying to be" PHP Html and MySqli programmer coming from Ms Access and VB background. Can somebody please assist, as I am stuck and sweating with these calculations.An y suggestions on how to populate the relevant input text boxes in realtime when adding an IDNo to the screen in input textbox called IDNO? Currently it only populate the mysqli database on pressing the submit button.

    Example Identity number = 63021854485519...
    See more | Go to post

  • JForbes, I got it working with the Sql added to the query. Thx for the trouble. You are a Star!
    See more | Go to post

    Leave a comment:


  • Thx for advice JForbes.I agree thats the way i would have preferred to go, but the about 550 items here are populated onto a screen alphabetically from top to bottom, and the data is filled in from left to right, for ease of capturing as the users battle to find correct items if having to lookup by names.So i am extracting some of this info from left to right for different reports. Thx for prompt reply
    See more | Go to post

    Leave a comment:


  • Thx I will give it a try. The "X" is added for those months the stock is unobtainable from the supplier, and thats why i need to be able to remove it from the avg calculation, as it will skew the overall averages for the other months. Otherwise , it would be straightforward just to divide by the number of months.
    See more | Go to post

    Leave a comment:


  • Calculate the average from multiple text fields and ignore if value is not numeric

    I have a tricky average calculation using multiple text fields and need to ignore non numeric values but include zero in avg calculation.
    If fields are all Text format
    Jan = 10
    Feb = 0
    Mar = 15
    Apr = X
    May = 15

    The avg here is 10+0+15+15/4 = 10
    We need to use dsum to add up the IsNumeric values and us DCount to divide by IsNumeric values
    It should be doing the following but i...
    See more | Go to post

  • neelsfer
    replied to Audit Trail - SubForm
    If you do not come right with Rabbit's adjustments then look at this example that i downloaded and adapt your code accordingly. I struggled with the exact same problem (and code) for days and easily managed to sort it out, using this method
    In the subform adapt code like this. See example of audittable for fields where changes are saved.
    Code:
    Option Explicit
    Const txtTableName = "yoursubformname"
    Code:
    'Choose a field in subform
    ...
    See more | Go to post

    Leave a comment:


  • I use this utility i got from the net once upon a time. Customize it for you and check the code. It is a separate utility, but works great. Hold in shift when opening...
    See more | Go to post

    Leave a comment:


  • I struggled for days as my subform combobox uses numerous "if then" statements and validations and eventually, i started to a requery a popup form from the combobox "after update event" (popup=yes/modal=no)that contains the relevant subform. It works fine now and also does not affect performance.
    Requery code:
    Code:
    Forms![Popupform].[subform].Form.Requery
    See more | Go to post

    Leave a comment:


  • neelsfer
    replied to Help on learning Visual Basic
    A lot of the concepts are also well explained on Youtube - i am also going through the same learning curve now with VB2012 - very steep for me but rewarding.
    There are also numerous VB2010/2012 complete books in pdf on the net, that can be downloaded. Find some titles in the online "bookshops" and google.
    See more | Go to post

    Leave a comment:


  • Hi Neopa. I have tried for 2 solid evenings using all sorts of different options and acspreadsheetty pes, and researched the net. I use Excel 2007 and it only imports xlsx files with this code, although i can view xls or xlsx file names, when opening it with the "msoFileDialogF ilePicker". The error message is then :"external table is not in the expected format".

    I would prefer to only import xls as the default format,...
    See more | Go to post
    Last edited by NeoPa; Aug 22 '14, 05:26 PM. Reason: Made pics viewable.

    Leave a comment:

No activity results to display
Show More
Working...