query whole of database

This is a discussion on "query whole of database" within the PHP Forum section. This forum, and the thread "query whole of database are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 9th, 2007, 01:21
saltedm8's Avatar
Lead Administrator

SuperMember
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,298
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
query whole of database

would someone be able to tell me how to query the whole of the database and then recover 'popular' words from that database, or maybe even 'selected' tables from the same database , this is what i have so far ( my first php script )

Code: Select all
 <?php
                #connect to MySQL
    $conn = @mysql_connect ( "localhost", "root", "" )
                           or die ( "Err:Conn" );
 
    #select the specified database
    $rs = @mysql_select_db( "mysql", $conn )
                       or die ( "Err:Db" );
     #create the query
    $sql="SELECT * FROM `sd_p2_news` WHERE 1";
 
    #execute the query
    $rs = mysql_query ( $sql,$conn );
 
    #write the data
    while ( $row = mysql_fetch_array( $rs ) );
 
    // Performing SQL query
                $query = 'SELECT * FROM `sd_p2_news` WHERE 1'; //ADJUST TO SEARCH ALL DATABASE  //
 
       $result = mysql_query($query);
                // Printing results in HTML
               echo "<table>\n";// echo simply 'prints text to the browser' 
               while ($line = mysql_fetch_array($result, MYSQL_ASSOC)
 
      )
 
       { 
 
      // similar to mysql_fetch_row above. 
               echo "\t<tr>\n";
               foreach ($line as $col_value) 
 
     {
 
      // retreives as $col_value each entry in array $line 
               echo "\t\t<td>$col_value</td>\n";
               }
               echo "\t</tr>\n";
               }
               echo "</table>\n";
please dont go 'too techie' on me, cheers
__________________
My Recipe forum...don't click here
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)

Last edited by saltedm8; May 9th, 2007 at 01:27.
Reply With Quote

  #2 (permalink)  
Old May 9th, 2007, 12:50
saltedm8's Avatar
Lead Administrator

SuperMember
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,298
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
Re: query whole of database

sorry, i just had to add that i also want to discount certain 'popular' words like 'and' 'but' 'because' etc... from appearing
__________________
My Recipe forum...don't click here
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Reply With Quote
Reply

Tags
database query

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nav bar query Scottie Starting Out 10 Jun 9th, 2008 21:23
Query Pulling Wrong information from MySQL database :: Cactushop Andrew1986 Classic ASP 1 Oct 3rd, 2007 11:06
MySQL query query dangergeek Databases 3 Apr 12th, 2007 12:45
Database Design Query gustava32 Databases 4 Nov 6th, 2006 15:30
XML Code for transfering data from one SQL Server Database to another database plolla Other Programming Languages 1 Aug 3rd, 2006 18:37


All times are GMT. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43