me looking so small in this world

20 2007f May, 2007

altering mysql column definition

Filed under: mysql — rudyegenias @ 3:26 pm

Have set my database and it was the perfect database I have ever designed(perhaps) but how about trying to edit the columns?

Here is the code:

alter table account modify `id` int(11) NOT NULL AUTO_INCREMENT;

Note: the id column is bigint(9) before the transformation.

thanks mellow_bunny of centos.org forums

Filed under: appreciations, woes — rudyegenias @ 1:58 pm

This blog has been hit, re-hit, again and again. Thanks to mellow_bunny of centos.org forum. This blog has been of help again. :) cheers.

http://www.centos.org/modules/newbb/viewtopic.php?topic_id=7803&forum=37

resetting the auto_increment field in mysql

Filed under: mysql, php — rudyegenias @ 1:38 pm

Oftentimes one needs to test web application to see if it works. But during those times one doesn’t have to retain all of the test data and after you delete the test data the auto_increment field(mostly id’s) don’t reset itself.

Here is a way to reset the auto_increment column in your mysql database:

alter table account auto_increment=4;

Guessing that I have 3 accounts I wanted to retain.

find the next auto_increment number in mysql

Filed under: mysql, php, phpmyadmin — rudyegenias @ 1:34 pm

Finding the next auto_increment is easy on phpmyadmin. Just select your database from the left side dropdown box. Then select the table on the lower part of it. Then click structure.

But what if it’s in mysql? or in PHP?
In PHP:

<?
$tablename         = “tablename”;
$next_increment     = 0;
$qShowStatus         = “SHOW TABLE STATUS LIKE ‘$tablename’”;
$qShowStatusResult     = mysql_query($qShowStatus) or die ( “Query failed: ” . mysql_error() . “<br/>” . $qShowStatus );

$row = mysql_fetch_assoc($qShowStatusResult);
$next_increment = $row['Auto_increment'];

echo “next increment number: [$next_increment]“;
?>

source: http://blog.jamiedoris.com/geek/560/

In MySQL prompt:

SHOW TABLE STATUS LIKE ‘tablename’;

3 2007f May, 2007

new look, old design

Filed under: woes — rudyegenias @ 9:14 am

Have been enduring the long run of posting comment only for the design to hide it on it’s div. Damn. Anyways it’s free one have to suffer from some inconvenience.

This
new look have been chosen with factors: simplicity, liquid design
capability (one that does wrap itself on any browser size), cleaner
look, and display my long comments that doesn’t break and some posts
too.

I will review the other posts if it gone well with the new one.

Thanks and enjoy.

Blog at WordPress.com.