NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Just starting out help....

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
7 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 08-07-2004, 03:48 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Aug 2004
Location: Pittsburgh
Posts: 3
designer2004 is an unknown quantity at this point
 



Just starting out help....


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 Code:
<?php
     
// Connection parameters

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

     
$connect mysql_connect (DB_HOSTDB_USERDB_PASSWORD) or die (mysql_error());
????: NamePros.com http://www.namepros.com/code/42376-just-starting-out-help.html

     
mysql_select_db (DB_NAME);
?>
Now my index page.
????: NamePros.com http://www.namepros.com/showthread.php?t=42376

PHP Code:
<?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
designer2004 is offline  
Old 08-10-2004, 05:15 PM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



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']; 
}
deadserious is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 07:18 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger