Search found 8 matches

Fri May 10, 2013 3:32 am
Forum: mySQL & php coding
Topic: Distance calculation based on multiple locations (Lat,Lon)
Replies: 1
Views: 609

Re: Distance calculation based on multiple locations (Lat,Lo

Ok. I worked it out with help of mac_gyver (php freaks). All calculations are done as i wish. My code below: <? include "connectdb.php"; \$driver = 5; \$datestamp = '2013/05/07'; \$result2 = mysql_query("SELECT * FROM drivers WHERE id='\$driver' LIMIT 1") or die(mysql_error()); while(\$row2 = mysql_fetch...
Thu May 09, 2013 10:48 pm
Forum: mySQL & php coding
Topic: Distance calculation based on multiple locations (Lat,Lon)
Replies: 1
Views: 609

Distance calculation based on multiple locations (Lat,Lon)

0 down vote favorite I would like to calculate the total distance of driving beetween multiple locations (loop), including the distance (starting point (garage) - first location sarting point) and (last location finishig point - finishing point (garage)). Example: (Garage + D1) + (D1 + D2) + (D2 + E...
Sun May 05, 2013 2:14 am
Forum: JavaScript
Topic: Order Form - JS Alert when all the input fields values are 0
Replies: 1
Views: 1553

Re: Order Form - JS Alert when all the input fields values a

Found the solution on another forum. function validateForm(){ var inputs = document.getElementsByTagName('input'); var noneZeroFound = false; for(var i=0;i< inputs.length;i++){ var input = inputs[i]; if(input.value != '0'){ noneZeroFound = true; break; } } if(!noneZeroFound ){ alert('MUST ENTER VALU...
Sat May 04, 2013 11:31 pm
Forum: JavaScript
Topic: Order Form - JS Alert when all the input fields values are 0
Replies: 1
Views: 1553

Order Form - JS Alert when all the input fields values are 0

Hi Everyone. I'm working on a basic ordering form. What i'm trying to achive is to get javascript to return alert when all the inputs fields are with values 0. At least 1 of the inputs has to be filled in with value more then 0 in order to proceed with a ordering form. I have to mention that product...
Tue Jan 08, 2013 12:44 am
Forum: mySQL & php coding
Topic: Using Variable in MySQL query
Replies: 2
Views: 744

Re: Using Variable in MySQL query

got it fixed .. \$result1=mysql_query("SELECT ".\$data1." as data1 FROM packaging WHERE orderno='\$orderno' LIMIT 1") or die(mysql_error()); while(\$row1 = mysql_fetch_array( \$result1 )) { \$data = \$row1['data1']; if ( \$data == '' ) {} else { echo" <tr><td>\$name</td><td>\$data</td><td>£\$price</td><t...
Tue Jan 08, 2013 12:03 am
Forum: mySQL & php coding
Topic: Using Variable in MySQL query
Replies: 2
Views: 744

Re: Using Variable in MySQL query

for example when i hardcode the query, results are ok and that is what i want to achive here

Code: Select all

``````\$result1=mysql_query("SELECT pack01 FROM packaging WHERE orderno='\$orderno' LIMIT 1") or die(mysql_error());
while(\$row1 = mysql_fetch_array( \$result1 )) {
\$pack01 = \$row1['pack01'];
echo "\$pack01";
}
``````
Mon Jan 07, 2013 10:18 pm
Forum: mySQL & php coding
Topic: Using Variable in MySQL query
Replies: 2
Views: 744

Using Variable in MySQL query

Hi everone. Having a problem with getting the values from a database. What im trying to do is: I use variable 'varname' from packaging_items table (values are coressponding to the names of columns in packaging table ... pack01, pack02 .. and so on). But in query result1 instead of getting the value ...
Sun Jan 06, 2013 12:45 am
Forum: PHP coding => General
Topic: Calculate distance with variable lat and lon values
Replies: 0
Views: 1335

Calculate distance with variable lat and lon values

I have a problem with implementing variables into a function that calculate distance between 2 latitudes, longitudes. One of them is constant, and the second one being passed from the form. Here is the code: \$lon1 = \$_POST['lon1']; \$lat1 = \$_POST['lat1']; \$lon2 = '-0.30020239'; \$lat2 = '51.58734910'...