Re: Dealer Locator
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 70039
interpreted = N
texte = Alex the key to this little app is in my database. I used a stored procedure and a stored function. The function calls the procedure. I have the php code and a link to the mysql backup/restore routine.In the php code you will need to set the server/username/password/ db. I used localhost but your mileage may vary. In the sql routine you will need to set the "Definer" that is the mysql user that is actually executing the store procedure/function. Once you download the file do a search for 'yourusername' in this file and replace with your actual mysql username.Here is the php code";//echo $mydist . "
";//connect to DB//set your server, username, password and database here$mysqli = new mysqli("localhost", "username", "password", "CYBER_TOOLS");/* check connection */if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit();}// the SQL$query = "CALL GetNearbyZipCodes('$myzip',$mydist)";//echo $query;if ($result = $mysqli->query($query)) { /* fetch associative array */ echo "
"; while ($row = $result->fetch_assoc()) { echo $row["zipcode"] .","; } /* free result set */ $result->close();} echo "";/* close connection */$mysqli->close();?>Yeah not much to it as its all in the store procedure/function.Here is a link to the mysql db backup/restore It is fully safe for consumption, do a search for 'yourusername' in this file and replace with your actual mysql username:http://www.cybermill.com/tools/cyber_tools.sqlI use navicat for mysql administration it takes care of creating and editiing of the store procedure/functions. I am not sure if phpMyAdmin or other tools are capable of creating, editing or restoring this.Robert MinorDirector of Internet Services------------------------------------------------------------Cybermill Communicationshttp://www.cybermill.com http://www.merchantmaker.comProviding Ecommerce and interactive website development andhosting services on Macintosh, Windows NT, *nix, and AS/400.Complete ddos proof hosting solutions and network services.On Apr 8, 2008, at 09:45 39, Alex McCombie wrote:> Bob,> Yeah that might work. I have mysql on an apache/winbox as well but > perhaps I> can retro this to pure DNA.>> I do like the idea of the middle context to make this easily available> across multiple sites.>> Thanks.> Alex>>>>>> On 4/8/08 10:08 AM, "Bob Minor"
wrote:>>> Yeah I did,>>>> http://www.weeones.com/>>>> but I did it with a curl to a php/mysql page. I keep it as a tool for>> all my sites. And then whenever I need it I just access it via a curl>> like so:>>>> [middle startafter=&endbefore=][shell]curl>> "www.nameofyourserver.com/tools/getzips.php?zip=>> [zipcode]&dist=[within]">> [/shell][/middle]>>>> I can shoot you the mysql db and the php code if your interested. The>> php page returns a comma delimited list of zipcodes, between the>> I have it running on a xserve but I am sure it would >> run>> fine on a windows/linux box with php/msql>>>> Robert Minor>> -- > Alex J. McCombie>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .>> Adventure Skies Interactive>> Box 124 Martville, NY 13111>> p. 315 .233 .9403>> e. Alex@AdventureSkies.com>> www.AdventureSkies.com>>>>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to >> Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Alex the key to this little app is in my database. I used a stored procedure and a stored function. The function calls the procedure. I have the php code and a link to the mysql backup/restore routine.In the php code you will need to set the server/username/password/ db. I used localhost but your mileage may vary. In the sql routine you will need to set the "Definer" that is the mysql user that is actually executing the store procedure/function. Once you download the file do a search for 'yourusername' in this file and replace with your actual mysql username.Here is the php code";//echo $mydist . "
";//connect to DB//set your server, username, password and database here$mysqli = new mysqli("localhost", "username", "password", "CYBER_TOOLS");/* check connection */if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit();}// the SQL$query = "CALL GetNearbyZipCodes('$myzip',$mydist)";//echo $query;if ($result = $mysqli->query($query)) { /* fetch associative array */ echo ""; while ($row = $result->fetch_assoc()) { echo $row["zipcode"] .","; } /* free result set */ $result->close();} echo "";/* close connection */$mysqli->close();?>Yeah not much to it as its all in the store procedure/function.Here is a link to the mysql db backup/restore It is fully safe for consumption, do a search for 'yourusername' in this file and replace with your actual mysql username:http://www.cybermill.com/tools/cyber_tools.sqlI use navicat for mysql administration it takes care of creating and editiing of the store procedure/functions. I am not sure if phpMyAdmin or other tools are capable of creating, editing or restoring this.Robert MinorDirector of Internet Services------------------------------------------------------------Cybermill Communicationshttp://www.cybermill.com http://www.merchantmaker.comProviding Ecommerce and interactive website development andhosting services on Macintosh, Windows NT, *nix, and AS/400.Complete ddos proof hosting solutions and network services.On Apr 8, 2008, at 09:45 39, Alex McCombie wrote:> Bob,> Yeah that might work. I have mysql on an apache/winbox as well but > perhaps I> can retro this to pure DNA.>> I do like the idea of the middle context to make this easily available> across multiple sites.>> Thanks.> Alex>>>>>> On 4/8/08 10:08 AM, "Bob Minor" wrote:>>> Yeah I did,>>>> http://www.weeones.com/>>>> but I did it with a curl to a php/mysql page. I keep it as a tool for>> all my sites. And then whenever I need it I just access it via a curl>> like so:>>>> [middle startafter=&endbefore=][shell]curl>> "www.nameofyourserver.com/tools/getzips.php?zip=>> [zipcode]&dist=[within]">> [/shell][/middle]>>>> I can shoot you the mysql db and the php code if your interested. The>> php page returns a comma delimited list of zipcodes, between the>> I have it running on a xserve but I am sure it would >> run>> fine on a windows/linux box with php/msql>>>> Robert Minor>> -- > Alex J. McCombie>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .>> Adventure Skies Interactive>> Box 124 Martville, NY 13111>> p. 315 .233 .9403>> e. Alex@AdventureSkies.com>> www.AdventureSkies.com>>>>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to >> Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Bob Minor
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
PSC recommends what date format yr 2000??? (1997)
ShowIF Question (2000)
Text data with spaces in them... (1997)
[WebDNA] Putting '&search' into URL killing all search contexts on my sites (2010)
WebCatalog 3.0.8 is on FTP... (2000)
Re:no template caching (1997)
WebDelivery downloads alias, not original ? (1997)
[WebDNA] duplicate cookies being stored in browser (2010)
taxTotal confusion (1998)
PIXO with cometsite ... and/or other plugins (1998)
problems with 2 tags (1997)
Sorting Number with commas (2001)
Displaying text and populating form fields (again) (2005)
Setting up shop (1997)
Exclamation point (1997)
Security Question (1997)
Req: Array Tags Explained, simple and clear (2003)
RE: Can a database get stomped by simultaneous access? (1997)
Web Catalog 2 demo (1997)
Limiting user access to .tmpl files (1997)