Ask a Question related to PHP Development, Design and Development.
-
oeyvind toft #1
argument is not a valid
I have installed PHP 5.
When I test various php/mysql scripts I`ve written earlier (php 4) I get
this kind of warning on every one
(Connecting (mysql_connect()) to mysql works fine):
"Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in
c:\Inetpub\wwwroot\php_testing_01\databases\databa ses_in_vtc_php_course\feed
back\resultsbygenre.php on line 37"
Every mysql function generates a "supplied argument is not a valid MySQL
result resource" warning.
Anybody have a clue ?
Oeyvind
--
[url]http://home.online.no/~oeyvtoft/ToftWeb/[/url]
oeyvind toft Guest
-
#39259 [NEW]: imap_delete argument is not a valid imap resource
From: mark at runryder dot com Operating system: Linux 2.6.11.4-21.14-bigsmp PHP version: 5CVS-2006-10-25 (snap) PHP Bug Type: ... -
mysql_num_rows(): supplied argument is not a valid MySQL result resource
I've got the following error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in... -
#24720 [Opn->Fbk]: mysql_result(): supplied argument is not a valid MySQL result resource
ID: 24720 Updated by: sniper@php.net Reported By: adrian at smartcall dot ro -Status: Open +Status: ... -
#24721 [NEW]: mysql_result(): supplied argument is not a valid MySQL result resource
From: adrian at smartcall dot ro Operating system: linux slackware PHP version: 4.3.2 PHP Bug Type: *Database Functions Bug... -
#24720 [NEW]: mysql_result(): supplied argument is not a valid MySQL result resource
From: adrian at smartcall dot ro Operating system: linux slackware PHP version: 4.3.2 PHP Bug Type: *Database Functions Bug... -
root@seraphim.jspazi.com #2
Re: argument is not a valid
You really should add the code to your post as its impossible to locate
the problem without it. Usually its a screwy variable or a bum SQL
statement that raises this error.
-J
root@seraphim.jspazi.com Guest
-
oeyvind toft #3
Re: argument is not a valid
I forgot to mention that the scripts that now generates warnings worked
perfect
in php 4. I didnt expect the scripting to be the problem.
Here is the part of a script that doesnt work:
$db = mysql_connect("localhost",'vinyl_user','vinyl_pass ');
mysql_select_db("vinyldealers", $db);
$query = "SELECT * FROM shops";
$result = mysql_query($query);
$table = mysql_field_table($result, 0);
echo $table;
This and similar mysql/php scripts generates this warning:
"Warning: mysql_field_table(): supplied argument is not a valid MySQL result
resource in
c:\Inetpub\wwwroot\php_testing_01\databases\databa ses_in_vtc_php_course\feed
back\resultsbygenre.php on line 37"
Oeyvind
--
[url]http://home.online.no/~oeyvtoft/ToftWeb/[/url]
<root@seraphim.jspazi.com> skrev i melding
news:Pine.LNX.4.58.0407151459420.21924@seraphim.js pazi.com...> You really should add the code to your post as its impossible to locate
> the problem without it. Usually its a screwy variable or a bum SQL
> statement that raises this error.
> -J
>
oeyvind toft Guest
-
eclipsboi #4
Re: argument is not a valid
The error indicates your query was not successful at some point. Try
adding in some error checking along the way to help yourself debug the
problem. For example, try rewriting this part of the script to
something like:
function merror($error) {
trigger_error($error, E_USER_WARNING);
}
$db = mysql_connect("localhost", "vinyl_user", "vinyl_pass");
if (!empty($db)) {
mysql_select_db("vinyldatabase", $db) Or
merror(mysql_error());
$query = "SELECT * FROM shops";
$result = mysql_query($query);
if (!empty($result)) {
$table = mysql_field_table($result, 0);
echo $table;
}
else {
merror(mysql_error());
}
}
else {
merror(mysql_error());
}
YMMV, but you get the general idea of what this does. Basically it
should pinpoint exactly where in your script it's flopping.
On Thu, 15 Jul 2004 22:46:18 +0200, "oeyvind toft"
<oeyvtoft@online.no> wrote:
>I forgot to mention that the scripts that now generates warnings worked
>perfect
>in php 4. I didnt expect the scripting to be the problem.
>
>Here is the part of a script that doesnt work:
>
>$db = mysql_connect("localhost",'vinyl_user','vinyl_pass ');
> mysql_select_db("vinyldealers", $db);
> $query = "SELECT * FROM shops";
> $result = mysql_query($query);
> $table = mysql_field_table($result, 0);
> echo $table;
>
>This and similar mysql/php scripts generates this warning:
>
>"Warning: mysql_field_table(): supplied argument is not a valid MySQL result
>resource in
>c:\Inetpub\wwwroot\php_testing_01\databases\datab ases_in_vtc_php_course\feed
>back\resultsbygenre.php on line 37"
>
>Oeyvindeclipsboi Guest
-
oeyvind toft #5
Re: argument is not a valid
Thanks for the input eclipsboi...
However, I`m embarassed to say that the problem was
that I didnt set up proper grants for the users after reinstalling
my system and mysql...
Sorry....
Oeyvind
--
[url]http://home.online.no/~oeyvtoft/ToftWeb/[/url]
"eclipsboi" <eclipsboi@hotmail.com> skrev i melding
news:n9sdf0lqqegim1gs5hnqc67usuro2hen4e@4ax.com...result> The error indicates your query was not successful at some point. Try
> adding in some error checking along the way to help yourself debug the
> problem. For example, try rewriting this part of the script to
> something like:
>
> function merror($error) {
> trigger_error($error, E_USER_WARNING);
> }
>
> $db = mysql_connect("localhost", "vinyl_user", "vinyl_pass");
>
> if (!empty($db)) {
> mysql_select_db("vinyldatabase", $db) Or
> merror(mysql_error());
>
> $query = "SELECT * FROM shops";
> $result = mysql_query($query);
>
> if (!empty($result)) {
> $table = mysql_field_table($result, 0);
> echo $table;
> }
> else {
> merror(mysql_error());
> }
> }
> else {
> merror(mysql_error());
> }
>
> YMMV, but you get the general idea of what this does. Basically it
> should pinpoint exactly where in your script it's flopping.
>
> On Thu, 15 Jul 2004 22:46:18 +0200, "oeyvind toft"
> <oeyvtoft@online.no> wrote:
>> >I forgot to mention that the scripts that now generates warnings worked
> >perfect
> >in php 4. I didnt expect the scripting to be the problem.
> >
> >Here is the part of a script that doesnt work:
> >
> >$db = mysql_connect("localhost",'vinyl_user','vinyl_pass ');
> > mysql_select_db("vinyldealers", $db);
> > $query = "SELECT * FROM shops";
> > $result = mysql_query($query);
> > $table = mysql_field_table($result, 0);
> > echo $table;
> >
> >This and similar mysql/php scripts generates this warning:
> >
> >"Warning: mysql_field_table(): supplied argument is not a valid MySQLd>> >resource in
>c:\Inetpub\wwwroot\php_testing_01\databases\datab ases_in_vtc_php_course\fee>> >back\resultsbygenre.php on line 37"
> >
> >Oeyvind
oeyvind toft Guest



Reply With Quote

