DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Database Connection Chunk

  • submit to reddit
mysql_select_db($database_conname, $conname);

$query_name = "SELECT * FROM tablename ORDER BY column DESC LIMIT 0, 10";
$name = mysql_query($query_name, $conname) or die(mysql_error());
$row_name = mysql_fetch_assoc($conname);
$totalrows_name = mysql_num_rows($conname);