Note that there are some explanatory texts on larger screens.

plurals
  1. POInteger that begins with zero converting to string (and keep that leading zero)
    primarykey
    data
    text
    <p>my problem is this one, I have a javascript code that gets GPS location from a browser. Then, because I can't write those coordinates to SQL database from javascript and I can't send it directly to php, I go to the controller "site" and it's method "writeToDatabase" and I also add 4 segments to URL that are actually those coordinates that I got from javascript..</p> <p>so in javascript I have:</p> <pre><code>window.location = getBaseURL() + "site/writeToDatabase/" + splittedLatitude[0] + "/" + splittedLatitude[1] + "/" + splittedLongitude[0] + "/" + splittedLongitude[1] + "/"; </code></pre> <p>so now the browser goes to (just an example with fake coordinates) www.mysite.com/index.php/site/writeToDatabase/47/707223/16/054322</p> <p>now my writeToDatabase method in site controller reads those segments (I use codeigniter so it is really easy to read segments of URL). After I read segments, I concat first part of latitude and second part of latitude, and also put a dot "." in between (so in this example I get 47.707223 and 16.54322), and I do the same with the longitude.. then when I write those data to database, I get weird numbers in my database, also if one of my segments begins with zero (just like in my example above), the zero gets removed so from 054322 I get 54322, and that leads to 16.54322 just like in the example above :)</p> <p>now this problem with strange numbers only occurs if I try to write to database whole coordinates.. if I just write first part of longitude, or just second part of longitude (same goes for latitude) everything goes well and correct value gets written..</p> <p>anyone else has a solution to this problem? I'm all out of ideas</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload