Absolutely Tech

Get Auto Increment value from MySQL table


Many a times we require the next Auto Increment value from a MySQL table. Most of the people would do something like this:

$query = "Select MAX(id) from users";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$maxid = $row['MAX(id)'];
echo $maxid;

This would give correct results but if we delete the latest row, it will start to give wrong results.

We’ve got another query which can be used to get correct ‘Auto Increment’ values from the table.
Read the rest of this entry »

[HowTo] Convert HTML to PDF using PHP


In a recent project, I had to output to a PDF file as well as to the browser. For this purpose first I downloaded the library from here. Then this code:

Read the rest of this entry »

Ubuntu 11.04

The next version of Ubuntu is coming soon

Follow me

Sponsors