how to count number of rows in a mysql query get total count rows
RegisterLogin
how to count number of rows in a mysql query get total count rows
Post Description: how to count number of rows in a mysql query get total count rows
Tags: how, to, count, number, of, rows, in, a, mysql, , query, get, total, count, rows
This Post Was Posted On Feb 29, 2008 By web hosting #1492
Post Description: how to count number of rows in a mysql query get total count rows
Tags: how, to, count, number, of, rows, in, a, mysql, , query, get, total, count, rows
This Post Was Posted On Feb 29, 2008 By web hosting #1492
how to count number of rows in a mysql query get total count rows by web hosting
for example, i have a forums and i want to know how many replies the topic number 455 has recieved, i can use this:
$sql = "SELECT COUNT(reply) WHERE topic='455'"
$row = mysql_fetch_row($result);
$count = $row[0];
$row = mysql_fetch_row($result);
$count = $row[0];
TEMPLATE:
$sql = "SELECT COUNT (field) WHERE field='$velue'"
$result = mysql_query($sql ,$db);
$row = mysql_fetch_row($result);
$count = $row[0];
$result = mysql_query($sql ,$db);
$row = mysql_fetch_row($result);
$count = $row[0];
hostman
#1930 1
this is anoter one i use
$db = mysql_connect("HOSTNAME", "USERNAME", "PASSWORD");
mysql_select_db("DATABASE_NAME",$db);
$sql2 = "select count(id) from ".$db_prefix."wallpaper WHERE status = '".$_GET['show']."'";
$result2 = mysql_query($sql2 ,$db);
$row2 = mysql_fetch_row($result2);
$num_of_items = $row2[0];
$start_reply = ($page_num * $replies_per_page);
$total_pages = ceil($reply_numbs/$items_per_page);
$db = mysql_connect("HOSTNAME", "USERNAME", "PASSWORD");
mysql_select_db("DATABASE_NAME",$db);
$sql2 = "select count(id) from ".$db_prefix."wallpaper WHERE status = '".$_GET['show']."'";
$result2 = mysql_query($sql2 ,$db);
$row2 = mysql_fetch_row($result2);
$num_of_items = $row2[0];
$start_reply = ($page_num * $replies_per_page);
$total_pages = ceil($reply_numbs/$items_per_page);
Feb 18, 2008 Reply Report abuse
©2012 Webune Forums - Sat Dec 15, 2012 6:02 pm
Powered by: Webune Forums V3
Powered by: Webune Forums V3