published by d.cochran on Thu, 10/22/2009 - 17:28
The following PHP code will help you acquire the latitude and longitude of a location (using an address, zip code, or city).
Note: Your will be required to have your own domain specific Google API key.
published by d.cochran on Mon, 02/09/2009 - 12:39
Below is a short function that will take any 10 or 9 digit number and convert it into the following phone format: 555-555-5555
published by d.cochran on Tue, 08/05/2008 - 07:26
I have several sites where I use a pop up table to display information if the user rolls over and image.
Example, if the user wants to view notes on a certain client, they can roll over a little "note" image to view the notes about the client pulled from a SQL database.
The code I use for a message may be:
published by d.cochran on Fri, 05/23/2008 - 09:21
Let's say that you have a bunch of data in a recordset and you want to populate that data into a list of variables. In my example we will draw 20 items from a players inventory from a MySQL table which stores all the items for a player in rows we call slot_1, slot_2, slot_3, … all the way to 20. So when we pull all of the items from the MySQL table we want to assign them to variables respectively. For example, our variable of "slot_1" that we are creating will equal "slot_1" from the MySQL table.
published by d.cochran on Fri, 02/22/2008 - 13:28
When you run a recordset through a loop, you will not be able to re-run the recordset further down in the same page. Here is how to reset the recordset so you can use it again on the same page. Just place this code after your loop. Change the "$Recordset" to your recordset's variable.
published by d.cochran on Thu, 11/22/2007 - 11:55
With PHP you can recognize the page you are on and then display a proper header for that page.
For example:
published by d.cochran on Wed, 11/21/2007 - 11:22
Looping comes in handy when you may want to execute a certain script "x" number of times or if you want to display all the information within a Recordset. Here is an example of how I display all the information stored within a Recordset into a nice table that is easy to read.
published by d.cochran on Tue, 11/20/2007 - 07:07
Recordsets in PHP are useful bits of code used to display data that is stored within a MYSQL table. You can run a loop to display all of this data or you can display only the bit of information you want. Here is how I do this:
Pages