scriptygoddess

Archive for the ‘mySQL’ Category

24 Mar, 2007

MySQL Cheatsheet

Posted by: Jennifer In: PHP| mySQL

Another mini-cheatsheet… I know this stuff, but I'm always looking it up for the exact syntax.
Connect to MySQL and to the database – mysql_connect
$connect = mysql_connect("localhost", "mysqluser", "userpassword") or die(mysql_error());
Select the database – mysql_select_db
mysql_select_db("databasename", $connect) or die(mysql_error());
Close connection – mysql_close
mysql_close($connect) or die(mysql_error());
Select data from the database – mysql_query
$myquery = "SELECT tablefield, tablefield2 FROM tablename WHERE [...]

27 Jun, 2004

Getting Dates in mySQL with MIN() and MAX()

Posted by: Jennifer In: mySQL

I'm working on a plugin that required getting the earliest date in the database, and also getting the oldest date in the database. I was hoping that there was a built-in function that did this – and there is.
I found this helpful article on various mySQL techniques. And this is the one I [...]

24 Jun, 2004

Reset autoincrement value in mysql tabl

Posted by: Jennifer In: mySQL

So tired of searching for this, (I know it's simple, but for some reason I can't seem to keep it in memory. LOL!)
You just deleted all the rows in a table – but when you add new rows – they're still starting where the deleted ones left off.
Run this sql query to reset the autoincrement [...]


Featured Sponsors


  • jerey: how do i rewrite this because it tried RewriteEngine on #Options +FollowSymlinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL
  • Jennifer: So I was testing this out to see if maybe something changed in the latest version - I had a test wordpress setup - and just dumped the mycomment funct
  • KDesign: Hi, thanks for the tutorial. I'm having problems though that I can't seem to find an answer to on the web. When I follow the example in the Codex h

About


Advertisements