Just starting out help....

SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back