Entries filed under 'Mysql'

How To Make An IP-To-Country Tool With PHP and MySQL

Filed under PHP, MySQL on 16.06.08

When it comes to creating web applications, there is no guarantee where your audience will hail from. You might be in sunny California, but in today’s global community it is almost certain that an English-language application will attract visitors from Canada, the UK, Australia, and probably many other countries as well.

Read the full entry... | Comment [1]

Building a simple PHP shopping cart

Filed under PHP, MySQL on 21.11.05

Update 21/11: I’ve added a demo and downloadable .zip file at the end of the article.

Update 07/12: Thanks to Greg and Rob Shan Lone for spotting a bug in the cart update code – I’ve now fixed this and updated the demo and .zip file; thanks guys!

Read the full entry... | Comment [113]

Order by numeric values in SQL

Filed under MySQL on 11.08.05

I didn’t know how to do this before today, so perhaps it might be of some use to someone else.

Normally a SQL query “ORDER BY fieldname” will do a straightforward string comparison; fine if you want to list items alphabetically, but not so good if you’re comparing numeric values, as you will end up with a list in non-numeric order, for example:

Read the full entry... | Add your comments [14]

|