Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How do you display all entries from a whole table?
Old 07-03-2004, 02:16 PM How do you display all entries from a whole table?
johanesw's Avatar
Extreme Talker

Posts: 174
Location: If I told you that, I'm afraid I'd have to kill you!
Trades: 0
Hi there...do you guys know how to echo all the entries in a whole table (MYSql). What function do you use? I mean the entire entries in a table not just one single row. Thanks guys.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
johanesw is offline
Reply With Quote
View Public Profile Visit johanesw's homepage!
 
 
Register now for full access!
Old 07-03-2004, 02:30 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
PHP Code:
$result mysql_query("SELECT * FROM mytable");
while(
$row mysql_fetch_array($result))
{
    
// print them out

Just a query without any WHERE clause.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 07-05-2004, 04:55 AM
johanesw's Avatar
Extreme Talker

Posts: 174
Location: If I told you that, I'm afraid I'd have to kill you!
Trades: 0
Ok
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
johanesw is offline
Reply With Quote
View Public Profile Visit johanesw's homepage!
 
Old 07-05-2004, 07:24 AM
johanesw's Avatar
Extreme Talker

Posts: 174
Location: If I told you that, I'm afraid I'd have to kill you!
Trades: 0
But then is there a way to refer each row separately after you get all the entries. Like if you want to diplay row 6 only you do something like $data[5]. Is there a way to do that?
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
johanesw is offline
Reply With Quote
View Public Profile Visit johanesw's homepage!
 
Old 07-05-2004, 07:38 AM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
All you have to do is build your own array,

PHP Code:
$data = array(); // initialize is to keep me happy (as you know, in PHP it's not required)
$result mysql_query("SELECT * FROM mytable");
while(
$row mysql_fetch_array($result))
{
    
$data[] = $row;


echo 
$data[5]['Name']; // echo row 6's field 'Name' (if it were to exist) 
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 07-05-2004, 07:43 AM
johanesw's Avatar
Extreme Talker

Posts: 174
Location: If I told you that, I'm afraid I'd have to kill you!
Trades: 0
Wow...Great..thanks a lot
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
johanesw is offline
Reply With Quote
View Public Profile Visit johanesw's homepage!
 
Reply     « Reply to How do you display all entries from a whole table?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44516 seconds with 12 queries