NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Number Of Rows In MySQL

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-24-2005, 05:33 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
buddybuddha's Avatar
Join Date: May 2005
Location: PA
Posts: 216
buddybuddha is an unknown quantity at this point
 



Number Of Rows In MySQL


Alright, I have no experience with MySQL, but if someone could guide me with tis one thing I need te do, that would be sweet.

I have a database named buddybud_nugget with a user of the same name. Inside, there is a table plog_blogs with a given number of rows. How can I use PHP to determine the number of rows in the table and then use that number as a a variable?

15 NP$ to whoever can tell me to my satisfaction.
buddybuddha is offline  
Old 08-24-2005, 05:41 PM   #2 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,272
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
 


Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
PHP Code:
<?php
????: NamePros.com http://www.namepros.com/programming/118278-number-of-rows-in-mysql.html
//Do all connect stuff up here

//Do sqlquery and get variable num
$sqlquery mysql_query("SELECT * FROM blah");
$num mysql_num_rows($sqlquery);

print 
"There is $num rows in blah";
?>
There yah go
__________________
I feel old.
iNod is offline  
Old 08-24-2005, 05:45 PM THREAD STARTER               #3 (permalink)
NamePros Regular
 
buddybuddha's Avatar
Join Date: May 2005
Location: PA
Posts: 216
buddybuddha is an unknown quantity at this point
 



But what code do I need to use for the connections. Ive barely even seen code for a mysql query.
buddybuddha is offline  
Old 08-24-2005, 05:50 PM   #4 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,272
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
 


Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
Here
PHP Code:
<?php
/* Set mysql variables */
$db_host "localhost"//Leave localhost
$db_user "inod"//DB username
$db_name "inod"//DB Name
$db_pass "pass"//DB User password

$connect mysql_connect("$db_host","$db_user","$db_pass") or die(mysql_error());
$select_db mysql_select_db("$db_name");

//Do sqlquery and get variable num
$sqlquery mysql_query("SELECT * FROM field_name");
????: NamePros.com http://www.namepros.com/showthread.php?t=118278
$num mysql_num_rows($sqlquery);

print 
"There is $num rows in blah"

?>
There..
__________________
I feel old.
iNod is offline  
Old 08-24-2005, 05:53 PM THREAD STARTER               #5 (permalink)
NamePros Regular
 
buddybuddha's Avatar
Join Date: May 2005
Location: PA
Posts: 216
buddybuddha is an unknown quantity at this point
 



15 NP$ your way!
buddybuddha is offline  
Old 08-24-2005, 05:54 PM   #6 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,272
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
 


Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
Received.. Thanks dude.. If you need any more help just pm me.. I would love to give you any kind of assistance you may need.

iNod
__________________
I feel old.
iNod is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 10:46 PM
updating multiple rows at a time (Mysql) Outer Programming 2 02-10-2005 08:26 AM
appraise please Complete Hostings Domain Appraisals 2 01-19-2005 04:03 PM
Tutorial: Getting Started With MySQL (The Basics) deadserious Webmaster Tutorials 3 04-18-2004 02:17 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:10 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger