Karl-Heinz Schulz wrote:

I have a simple question (not for me).

Why does this query does not work?

        $links_query = mysql_query("select id, inserted, title, information,
international from links WHERE international = y; order by inserted desc
LIMIT 0 , 30");

The information for the "international" fields are:

Field: international
Type: char(1)
Null: No
Default:n

The error is -> Warning: mysql_fetch_row(): supplied argument is not a valid
MySQL result resource in

Your query has failed. You'd know this if you checked mysql_error() after running your query.


$result = mysql_query(...) or die(mysql_error())

Your query fails because you need quotes around the "y" and you need to remove the semi-colon.

$links_query = mysql_query("select id, inserted, title, information,
international from links WHERE international = 'y' order by inserted desc LIMIT 0 , 30") or die(mysql_error());


Also, why are you selecting the international column when you're filtering the results to rows that have "y" for international. You already know what international is, why select it in your query?

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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



Reply via email to