Friday, 9. February 2007, 02:43:11
javascript, articles, flash, tribulant
...
My new website design :
http://www.tribulant.comFeel free to test out the site, scripts and other resources and post your comments here.
All comments will be greatly appreciated, since the site is still under fast development.
Sunday, 19. November 2006, 15:15:30
tribulant, website, Design, web development
...
I've always had the bad habit of revamping my sites way too often.
I used to have a site at
http://www.tribulant.com but there is nothing there now except for a "Coming Soon..." page.
I recently decided that I needed to get the site up and running again, so I've been spending some time on doing just that.
Screenshot :
This is what I have now.
It's not up yet, since I'm still working on the backend programming.
Let me know what you think of the design so far.
Monday, 18. September 2006, 00:16:55
php, last inserted id, mysql, mysql_insert_id()
...
In some cases, you will need to retrieve the
last inserted ID which was inserted into your database using
PHP specifically when you are using an '
auto_increment' parameter for that field. Obviously there is a common way of doing this, but there is also a built in function which will help you to achieve the same result with less code.
The common way :
$query = "INSERT INTO table (id, value) VALUES ('', 'value')";
mysql_query($query) or die(mysql_error());
$id = mysql_result((mysql_query("SELECT * FROM table WHERE value = 'value'")), 0, 'id');
echo "The last inserted ID was :" . $id;
The easy way :
$query = "INSERT INTO table (id, value) VALUES ('', 'value')";
mysql_query($query) or die(mysql_error());
echo "The last inserted ID was :" . mysql_insert_id();
A useful snippet if you aren't familiar with the '
mysql_insert_id()' function. This will save you some coding and time if you've been using other common, longer ways in the past.