IT.COM

Just starting out help....

Spaceship
Watch
Hello I am just starting out trying to learn PHP without taking scripts and modifying them to my likeing so now I just read tuts and books and code snippets. Now here is my code then is my problem.

My Connections page thats a bit modifyed so i can post it here.

PHP:
<?php
     // Connection parameters

     define ('DB_USER', '*****');
     define ('DB_PASSWORD', '*****');
     define ('DB_HOST', 'localhost');
     define ('DB_NAME', '*******');

     $connect = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) or die (mysql_error());

     mysql_select_db (DB_NAME);
?>

Now my index page.

PHP:
<?php
   include ('./includes/header.inc');
   include ('./includes/connections.php');



   $query = "Select * FROM  home_news";
   $result = mysql_query($query);
?>

Now i am sure im missing something or doing something wrong cuz on my page nothing comes up except for my header that includes just a navbar and a banner. Any help..? Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
You still need to echo the result.

You can try adding something like this at the bottom of your script.


Code:
while ($row = mysql_fetch_array($result)) { 
    echo $row['YourSelectedFieldName']; 
}

:tu:
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back