Current location: Hot Scripts Forums » Programming Languages » PHP » MYSQL Records..


MYSQL Records..

Reply
  #1 (permalink)  
Old 07-25-04, 09:29 AM
steveo steveo is offline
Wannabe Coder
 
Join Date: Jun 2004
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
MYSQL Records..

Hey, I can't really do MYSQL so I'm going to have to ask you in reallly simple terms. I want to connect to a database and show how many records they are in the database table and I don't know how to do it. Can anyone help?

(By my showing how many are in the table i'll use the echo function I think.)

Thanks in advance, steve..
Reply With Quote
  #2 (permalink)  
Old 07-25-04, 10:39 AM
MrKafaaski's Avatar
MrKafaaski MrKafaaski is offline
Newbie Coder
 
Join Date: Jul 2004
Location: Hurum, Norway
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

<?php

$link 
mysql_query("localhost""user""pass");
mysql_select_db("database"$link);

$query mysql_query("SELECT * FROM `table`"$link);
echo 
"Records: " mysql_num_rows($query);
?>
Reply With Quote
  #3 (permalink)  
Old 07-25-04, 11:23 AM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
Shouldn't it be

PHP Code:

$link mysql_connect("localhost""user""pass"); 

?
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Excel document containing records, need to save as a text file to upload to mysql bearslife PHP 1 06-05-04 03:24 AM
how to control access to specific mysql records for a user phpjunkie PHP 1 05-11-04 12:11 PM
mysql - auto deletion of records munricer Script Requests 0 10-05-03 03:21 PM
Repeating MySQL records in a mail script watix PHP 2 07-22-03 05:25 PM


All times are GMT -5. The time now is 04:14 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.