Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

pixel-efx APDZ Open Web Design Learn PHP Free 

Change Language

Who's online

There are currently 0 users and 6 guests online.

Databases

Convert MySQL Tables to SQLite Tables

If you are having trouble converting MySQL tables to SQLite tables then this tutorial is for you. On the other hand, if you have no idea what I just said then let me explain that both MySQL and SQLite are free, open source databases. While MySQL is the most used open source database in the world, SQLite is catching on as a great database for people who don't need a complex system to manage their data. I personally have been looking into it as a possibility for running my personal blog.


Submitted by David on December 13, 2007 - 8:36pm.
read more | add new comment

SELECT COUNT from database

I thought I would just take a minute to share this little code snippet with you as I had some trouble finding posts online that would tell me if I was going about this the right way! The problem is that I needed a fast way to count how many rows were in a database without using a CPU demanding function like mysql_num_rows().

<?php
$query 
'SELECT COUNT(*) FROM `users`';
$result mysql_query($query) or die('Sorry, we could not count the number of results: ' mysql_error());
$numberofresults mysql_result($result0);
?>

You can also limit the count to only rows that meet a certain value:

<?php
//Where the user id is greater than 149.
$query 'SELECT COUNT(*) FROM `your_table` WHERE `id` > 149';
$result mysql_query($query) or die('Sorry, we could not count the number of results: ' mysql_error());
$numberofresults mysql_result($result0);
?>


Submitted by David on May 14, 2007 - 12:16am.
read more | add new comment

Syndicate content


Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati