Re: visual foxpro 6 to mysql

Author: Kevin Cully

Posted: 2011-08-10 at 08:38:43

Hello Gary,

Graham gave some good advice. One thing I seem to recall people talking

about GoDaddy, is that there is a setting to allow for external

connections to the MySQL database. Something needs to be turned on for

that to work, if I recall correctly.

If you are using phpMyAdmin, you can use Foxpro to create a string of

INSERT statements. Check out TEXT ... ENDTEXT with the TEXTMERGE option.

SELECT MyCursorOfNewTeamStats

SCAN

TEXT TO lcNewStats ADDITIVE TEXTMERGE NOSHOW

INSERT INTO cTmStats (gamePK, cStat, nValue) VALUES

(<<MyCursorOfNewTeamStats.gamePK>>,'<<MyCursorOfNewTeamStats.cStat>>',<<MyCursorOfNewTeamStats.nValue>>);

ENDTEXT

ENDSCAN

_CLIPTEXT = lcNewStats && <-- Copies the series of INSERT statements

from variable lcNewStats to the clipboard

Now you can switch over to phpMyAdmin and paste in the series of

commands into the SQL window and execute it.

Quick. Dirty. Works. I (basically) use this scenario to update my

archery club's MySQL based calendar for the year.

-Kevin

On 08/09/2011 11:29 PM, Gary Jeurink wrote:

> I'm not great at PHP but I'm learning. Tables are cTeams, cGames, cTmstats.

> The cTmstats gets updated each week along with cGames that have been played.

> I don't know how to update the MySQL cTmStats with the foxpro cTmstats.dbf

> each Tuesday morning. I need to update the MySQL tables at godaddy with my

> foxpro data and I don't know how. PHP gives me access to MySQL but how do I

> connect foxpro? ... I tried delimited text but they usually crash at 1/2 to

> 2/3rds using MyAdmin... whatever its called.

>

> Gary Jeurink

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4E427BD3.8090900@cullytechnologies.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2011 Kevin Cully