Archive for the ‘MySQL’ Category

Some MySQL For The Brain

Tuesday, March 4th, 2008

Looking for a few, quick PHP+MySQL tips? You found some.
List all tables in the pre-set database:
SHOW TABLES;
Always, always, always use an auto-incrementing unique ID:
CREATE TABLE table_name (
id INT NOT NULL AUTO_INCREMENT,
table_field1 varchar(250) NOT NULL default ”,
PRIMARY KEY (id)
);
Adding to an auto-incrementing table:
@mysql_query(”insert into table_name values(NULL,’My Field’)”);
There’s actually three different PHP API’s which you can use:

The [...]

Using MySQL’s rand() Statement

Wednesday, October 24th, 2007

So, recently I’ve been working very hard on a TGP system of sorts…as you may already know. Well, I was trying everything to figure out how to get the listings in a MySQL database to “re-position” themselves, or using a better term, “rotate”. And, I did it! This was actually extremely simple compared to a [...]