RE: [PHP-DB] Not seeing whats wrong with code

2003-03-20 Thread Beverly Steiner
Mike,

Try mysql_fetch_array instead of mysql_fetch_row

--
Beverly Steiner
[EMAIL PROTECTED]


-Original Message-
From: Mike Delorme [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 12:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Not seeing whats wrong with code


Hello,

I am trying to write a script that conects to mysql, then SHA database. Then
I need to list ALL the rows of table members. It sais there is a error on
line 18. The while statement is on line 18, and I cant firgure out whats
wrong with it:

?
$host = localhost;
$uname = sniper;
$pass = starcraft;
$database = SHA;
$tablename = members;
$connect = mysql_connect ($host, $uname, $pass);
$select = mysql_select_db ($database);
$query = SELECT * from $tablename;
$result = mysql_query ($query)
while ($row = mysql_fetch_row($result))
{
$row
}
?

Thanks,
Mike Delorme


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Not seeing whats wrong with code

2003-03-19 Thread David Smith
Mike Delorme wrote:

Hello,

I am trying to write a script that conects to mysql, then SHA database. Then I need to list ALL the rows of table members. It sais there is a error on line 18. The while statement is on line 18, and I cant firgure out whats wrong with it:

?
$host = localhost;
$uname = sniper;
$pass = starcraft;
$database = SHA;
$tablename = members;
$connect = mysql_connect ($host, $uname, $pass); 
$select = mysql_select_db ($database);
$query = SELECT * from $tablename;
$result = mysql_query ($query)
while ($row = mysql_fetch_row($result))
{
$row

You are missing a semi-colon here. And you are not printing the info. 
Try this instead of $row: print_r( $row );.

}
?
Thanks,
Mike Delorme
--Dave

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Not seeing whats wrong with code

2003-03-19 Thread John W. Holmes
You're missing a semi-colon... I'll leave it up to you to find. :)

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Mike Delorme [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 20, 2003 12:01 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Not seeing whats wrong with code
 
 Hello,
 
 I am trying to write a script that conects to mysql, then SHA
database.
 Then I need to list ALL the rows of table members. It sais there is a
 error on line 18. The while statement is on line 18, and I cant
firgure
 out whats wrong with it:
 
 ?
 $host = localhost;
 $uname = sniper;
 $pass = starcraft;
 $database = SHA;
 $tablename = members;
 $connect = mysql_connect ($host, $uname, $pass);
 $select = mysql_select_db ($database);
 $query = SELECT * from $tablename;
 $result = mysql_query ($query)
 while ($row = mysql_fetch_row($result))
 {
 $row
 }
 ?
 
 Thanks,
 Mike Delorme



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Not seeing whats wrong with code

2003-03-19 Thread Max 'AMiGo' Gashkov
Should be:

?
$host = localhost;
$uname = sniper;
$pass = starcraft;
$database = SHA;
$tablename = members;
mysql_connect ($host, $uname, $pass);
mysql_select_db ($database);
$query = SELECT * from $tablename;
$result = mysql_query ($query);
while ($row = mysql_fetch_row($result))
{
...statements here...
}
?


MD Hello,

MD I am trying to write a script that conects to mysql, then SHA database. Then I 
need to list ALL the rows of table members. It sais there is a error on line 18. The 
while statement is on line 18,
MD and I cant firgure out whats wrong with it:

MD ?
MD $host = localhost;
MD $uname = sniper;
MD $pass = starcraft;
MD $database = SHA;
MD $tablename = members;
MD $connect = mysql_connect ($host, $uname, $pass); 
MD $select = mysql_select_db ($database);
MD $query = SELECT * from $tablename;
MD $result = mysql_query ($query)
MD while ($row = mysql_fetch_row($result))
MD {
MD $row
MD }
?

MD Thanks,
MD Mike Delorme


WBR,   Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
http://www.journals.ru/users/endymion
Distributed.net participant [408228][RC5-72]
__
NP: [Massimo Santucci] 2 love (first cut)


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php