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
