Re: Re: Error I dont understand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I understand the error, it usually means that you have upgraded your MySQL installation or PHP installation.  So, let's get to the basics, have you upgraded your MySQL or PHP installations lately?

Use this:

<?php
$link = mysql_connect('<put your MySQL server name here>, '<put your DB login ID here>', '<put your password here>');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?> 

See what that returns.  Then come back here and let us know if you can even make a connection to the database.


----- Original Message ----
From: Krishna Srikanth <krishna.srikanth@xxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Tuesday, June 12, 2007 4:50:38 AM
Subject: Re:  Re: Error I dont understand

Hi,

I see that you people are not understanding the error.

Warning: mysql_fetch_ array(): supplied argument is not a valid MySQL 
result resource.

There is no data table returned by the mysql, or either the database 
connection is not properly made.

First check whether the sql query formed is correct or not. 
Then check if there is some data to be returned. 

Alternately you can check mysql_num_rows, before mysql_fetch_ array.

Bye,
Manda Krishna Srikanth
http://www.ksjourna l.info

php-objects@ yahoogroups. com wrote on 06/12/2007 02:30:09 PM:

> Hi,
> U can try this with numeric index in place of string index.
> eg. $totalCost += ($row[0] * $row[1]);
> 
> --- In php-objects@ yahoogroups. com, "teacherweeks" <teacherweeks@ ...> 
> wrote:
> >
> > I am getting an error on a line of code that I don't understand and 
> I
> > am hoping that someone can explain it to me. I will include the 
> error
> > and line of code that it is telling me is the problem.
> > 
> > Weeks
> > 
> > Warning: mysql_fetch_ array(): supplied argument is not a valid MySQL
> > result resource. 
> > 
> > while($row = mysql_fetch_ array($result) ){
> > // Increment the total cost of all items
> > $totalCost += ($row["qty"] * $row["itemPrice" ]);
> >
=====-----== ===-----= ====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

[Non-text portions of this message have been removed]





       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux