Re: [PHP-DB] Parse error

2003-03-20 Thread Max 'AMiGo7; Gashkov
[EMAIL PROTECTED] wrote:


IBI> I am having a problem with a parse error.

IBI> error:
IBI> Parse error: parse error, unexpected ')' in
IBI> /Users/timbest/Sites/cajunmikes/inc/menupage.php on line 75

IBI> Fatal error: Cannot instantiate non-existent class: menu in
IBI> /Users/timbest/Sites/cajunmikes/TMPfj18cc2i20.php on line 7

IBI> The issue I am having is line 75 has no ')'.  I am sure this error is
IBI> causing the next fatal error.  Anyone seen this before?  I'm not sure what
IBI> to do next since there is nothing on line 75...

IBI> Thanks
IBI> /T 


Post some code here...



WBR,   Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
http://www.journals.ru/users/endymion
Distributed.net participant [408228][RC5-72]
__
NP: [DJ DADO/ FINE ARTS] next madness


-- 
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 'AMiGo7; Gashkov
Should be:




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>  $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



Re[2]: [PHP-DB] More help with mysql -- solved (bizarre)

2003-02-18 Thread Max 'AMiGo7; Gashkov
OK, now I see 8)

$result  after  your operations contains not SQL result, it's value is 1 (logical
TRUE)  -- result of logical operation

mysql_query("SELECT * FROM SOME_TABLE") || die(



If you want to exit after error try this construction:

if(!mysql_query("SELECT * FROM SOME_TABLE"))
{
   die(
};

EM> If I remove the '|| die' part from the mysql_query() statement, it works
EM> fine. This is bizarre, but there it is.

EM> ie, if I have:

EM> $result = mysql_query("SELECT * FROM SOME_TABLE");

EM> it works.

EM> If I have:

EM> $result = mysql_query("SELECT * FROM SOME_TABLE") || die ("Unable to execute
EM> SQL query");

EM> it doesn't work. It gives me: " Supplied argument is not a valid MySQL
EM> result resource"

EM> Anyway, since it works I don't suppose I should complain, but it seems
EM> pretty weird to me nevertheless.



WBR, Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
Distributed.net participant [408228][RC5-72]


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




Re[2]: [PHP-DB] More help with mysql

2003-02-18 Thread Max 'AMiGo7; Gashkov
Try listing of fields by name, not as '*', and put SOME_TABLE in qoutes (').

EM> - Original Message -----
EM> From: "Max 'AMiGo' Gashkov" <[EMAIL PROTECTED]>
EM> To: "Evan Morris" <[EMAIL PROTECTED]>
EM> Cc: <[EMAIL PROTECTED]>
EM> Sent: Tuesday, February 18, 2003 10:13 AM
EM> Subject: Re: [PHP-DB] More help with mysql


>> Possible error in SQL statement.
>> Are you sure that SOME_TABLE exists?

EM> Yes. I can connect to it from Perl, using the same user-pass credentials,
EM> and fetch our all the data without any problems.






WBR, Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
Distributed.net participant [408228][RC5-72]


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




Re: [PHP-DB] More help with mysql

2003-02-18 Thread Max &#x27;AMiGo7; Gashkov
Possible error in SQL statement.
Are you sure that SOME_TABLE exists?

EM> Hi all

EM> I have successfully managed to connect to the mysql database, using the
EM> following code:

EM> mysql_connect('localhost','php','***') || die ("Unable to connect to
EM> MySQL server.");
EM> $db = mysql_select_db("DB_NAME") || die ("Unable to select requested
EM> database.");

EM> I then issue the following command:

EM> $result = mysql_query("SELECT * FROM SOME_TABLE") || die(mysql_error());

EM> This does not result in any error.

EM> Now, of course, I want to work with the data returned, so I go:

EM> if (mysql_num_rows($result) > 0)
EM> {
EM> // do some stuff
EM> }
EM> else
EM> {
EM> // do some other stuff
EM> };

EM> However, this gives me: "Supplied argument is not a valid MySQL result
EM> resource."

EM> If I go: echo "$result", I get '1', so I know $result actually has some
EM> value.

EM> What am I doing wrong? Basically, I want to do the simplest thing: get data
EM> out of a table and step through the results, displaying them one by one. Why
EM> is this hard?

EM> Evan Morris
EM> [EMAIL PROTECTED]
EM> Tel: +27 11 792 2777
EM> Fax: +27 11 792 2711
EM> Cell: +27 82 926 3630

WBR, Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
Distributed.net participant [408228][RC5-72]


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