SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 14th, 2003, 10:38 PM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 6
Send a message via AIM to velocityX
Unhappy php code problem!

whats wrong with this?
PHP Code:
<?php

$username
="";
$password="";
$database="";

mysql_connect(localhost,$username,$password);
@
mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM gtrmembers";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$i=0;
while (
$i $num) {

$name=mysql_result($result,$i,"name");
$position=mysql_result($result,$i,"position");
$memberid=mysql_result($result,$i,"id");

?>
<? $name ?>
 - <? $position ?> - <a href="profile.php?id=<? " . $id . " ?>">profile</a><br>
<?
++$i;
}

?>

Reply With Quote
  #2  
Old August 14th, 2003, 11:09 PM
wastedbreath wastedbreath is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: BC, Canada
Posts: 35 wastedbreath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to wastedbreath
I'm not totally sure but trying getting rid of the

Code:
mysql_close();

Reply With Quote
  #3  
Old August 15th, 2003, 12:01 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
PHP Code:
 mysql_connect(localhost,$username,$password); 
Unless localhost is a constant you should put quotes around it
PHP Code:
"localhost" 
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > php code problem!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway