You are here: Re: can't find my error need fresh eyes « PHP Language « IT news, forums, messages
Re: can't find my error need fresh eyes

Posted by gagal on 07/20/07 14:38

On Jul 20, 4:33 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Rik)
>
>
>
> >On Fri, 20 Jul 2007 09:23:00 +0200, gagal <lynettesm...@gmail.com> wrote:
>
> >> Warning: mysql_query(): supplied argument is not a valid MySQL-Link
> >> resource in /home/smith/public_html/addressbook/ab_functions.php on
> >> line 87
> >> Query failed:
>
> >> function adminApprovalNeeded ($connect, $db_table4)
> >> {
> >> $sql = "SELECT * FROM $db_table4 WHERE 'approved' = '0'";
> >> 87 --> $result = mysql_query ($sql, $connect) or die ('Query failed:
> >> ' .mysql_error());
> >> $approved = mysql_num_rows($result);
> >> echo "Address Book - You have $approved entries waiting for
> >> approval.";
> >> }
>
> >The error is earlier, in the connection or the assigning it to $connect
> >itself. $connect does not hold a valid mysql-resource.
>
> Additionally, if that's the real code, the query will never return
> anything, because 'approved' will never be equal to '0' ...
>
> Micha

Yes, it is real code. After you said it wouldn't work, I went back
and tried again. It works this time (no 0 return). I still don't
understand why I am getting the error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /home/smith/public_html/addressbook/ab_functions.php on
line 95
Query failed:

I am using the same code in another functions page and it works. This
one works:

function adminApprovalNeeded ($connect, $db_table8)
{
$sql = "SELECT * FROM $db_table8 WHERE approved != '1'";
$result = mysql_query ($sql, $connect) or die ('Query failed:
' .mysql_error());
$approved = mysql_num_rows($result);
echo "Directory - You have $approved entries waiting for approval.";
}

This one doesn't work:

function adminApprovalNeeded ($connect, $db_table4)
{
$sql = "SELECT * FROM $db_table4 WHERE 'approved' != '1'";
$result = mysql_query ($sql, $connect) or die ('Query failed:
' .mysql_error());
$approved = mysql_num_rows($result);
echo "Address Book - You have $approved entries waiting for
approval.";
}

They are on seperate pages so they do not cause conflict with each
other. Please help!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация