I'm currently in training this week for ASP (and finally we're done with "review" – very long story). While little of this is useful for blogs, I still wanted to document what I'm learning. Here are my notes from class: (this is a VERY VERY long post.)
Recently my host, for whatever reason decided that it would be a better idea to NOT display errors if there was an error in the PHP code. Therefore if you had a parse error, instead of getting a helpful display that said such and gave you the line number, the page would just show a […]
If you admin a (U*ix) PHP server and… If you recompile PHP periodically and… If you use a lot of add-ins with PHP do yourself a favor & save your "./configure…" command to a file with: echo ./configure -my options- > configure.sh You can then chmod the file as you see fit so no one […]
Chalk this up to "not one of my finer (smarter) moments". This is so silly, I probably shouldn't even admit to not realizing this – but I'm putting it here so I never forget it again. I had wanted to run a SELECT query where the conditional would be set with the "LIKE" – but […]
Comments Off on sprintf and mySQL's "LIKE"
It is usually recommended to do some javascript validation on a form before it's sent. This way, you don't have to waste server resources doing this. (It's still recommended to do some server side validation as well – but hopefully you can cut out some of the mistakes with the client side/javascript validation).
(another non-blog post) Problem: Let's say you're displaying rows of data from your database, and there's just too many rows for one page. You'd like to show X number of rows of data per page, and then have "next"/"previous" buttons to navigate through the list. Let's also say you want to be able to sort […]
Ok… this is my first post here, so I'm going to start out relatively small. While I was working on the update of my flip gallery script today I needed a way to check a variable for a particular string, and if that string didn't appear I wanted to execute any php code that was […]
Again, another "not so interesting for blog stuff" type post. If you're displaying several rows of data and would like to alternate the background colors of the rows so they're easier to read: <? for ($i=0; $i<$someNumber; $i++) { ?> <tr <? if ($i%2) { ?> bgcolor="#CCCCCC" <? } ?>> <td>data</td> <td>more data</td> </tr> <? […]
This isn't exactly useful for blog stuff – but if you're using mySQL for a business application, then downloading your data into a CSV file (CSV = Comma Seperated Values) is probably something that might come in handy. The key that I've found is that you can have any kind of characters inside each field, […]
Some notes again (mainly for myself) but maybe it'll help someone. Problem: Create a form that (after inserting data into a database) takes a file and uploads it to the server after renaming it with the timestamp, auto_incremented id, and a value from one of the fields from the mysql insert. (heh. Still with me?) […]