PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 24th, 2009, 05:59 AM
gudivada213 gudivada213 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 gudivada213 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 23 sec
Reputation Power: 0
Php script for gps log data inserting into mysql

Hi,

I need to write php script to insert the data into mysql from gps log.

Suppose Gps log like below,

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283, 39,20,11,165,00*71
$GPGSV,3,2,11,17,24,208,39,27,11,097,00,13,87,174, 00,19,31,042,00*70
$GPGSV,3,3,11,25,43,033,38,03,07,037,00,23,47,150, 00*44
$GPGGA,111503,0833.6323,N,07652.7685,E,1,04,1.60,1 6.69,M,-94.088,M,,*58
$GPRMC,111503,A,0833.6323,N,07652.7685,E,0.1866,25 6.540,220609,,*2A
$GPGSA,A,3,08,28,17,25,,,,,,,,,0.0,1.6,16.3*02
$GPGGA,111504,0833.6316,N,07652.7682,E,1,04,1.60,1 8.70,M,-94.088,M,,*58
-
-
--
--

When the line starting with $GPRMC and the line status having "A" after two commas, then the line details should be insert into mysql database.
line in log like below:

$GPRMC,111503,A,0833.6323,N,07652.7685,E,0.1866,25 6.540,220609,,*2A

database details:

dbname: project
tablename: gps

fields in table:
Quote:
insert above line in table like this.

time : 111503
latitude : 0833.6323,N
longitude : 07652.7685,E
speed : 0.1866
date : 220609
Steps:

Script has to check whether the line starting with $GPRMC,
if it is: then Script has to check for status "A" after two commas
............... if it is
......................... data of that line should insert in mysql db
else
................ check next line....up to terminate the log


Please help me, how to achieve this task.

Thanks,
sravan

Reply With Quote
  #2  
Old June 24th, 2009, 09:01 AM
IkoTikashi's Avatar
IkoTikashi IkoTikashi is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Sep 2003
Location: Germany
Posts: 1,252 IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 7 h 20 m 5 sec
Reputation Power: 275
Maybe try a php csv class or something?
__________________
IkoTikashi - ikotikashi.de

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Php script for gps log data inserting into mysql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
Stay green...Green IT