if you are not getting a valid result set back,
then the sql server is returning some type of
error.

to find the error, try this:
if($select_=mysql_query($sql,$db->CONN)) {
        //query is good
        //continue code
} else {
        //query is bad
        $err=1
        $errMsg="Failed Query: $sql<br>".mysql_errno()." : ".mysql_error();
}

//in your html
if(!$err) {
        //display html stuff
} else {
        printf("%s",$errMsg);
}

---------------------
Johnny Withers
[EMAIL PROTECTED]
p. 601.853.0211
c. 601.209.4985
 

-----Original Message-----
From: Chris Bolt [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 06, 2001 11:51 AM
To: [EMAIL PROTECTED]
Subject: RE: QS works if applied through phpMyAdmin but not from a
PHP-Script


Have you looked at mysql_error() ? Are you sure $select_ is a valid php
variable name?

> Oi,
>
> I cannot get my head around that.
> I got a QS that worked fine, then I edited the PHP-script, not the part
> which is now causing errors, and it does not work anymore. That
> is strange,
> if there was a mistake in my query qhy should it work on my PC but not on
> the web? Well maybe different versions of mysql and PHP but then
> it should
> not work with the phpMyAdmin neither. This toll is using exactly the same
> programs as php does, in fact phpmyAdmin uses php for its
> communication to
> mysql.
>
> $sql = "SELECT DISTINCT region_2,stadt_2 FROM inserate ORDER BY
> region_2,stadt_2 ASC";
> $select_ = mysql_query($sql,$db->CONN);
> ^^^^^^^^^^
> ^Cannot be the mistake, cause some lines before it works perfectly well.
>
> while($temp_array = mysql_fetch_object($select_,MYSQL_ASSOC))
> ^^^^^^^^^
> This is causing the following
>
> Warning:  Supplied argument is not a valid MySQL result resource in...
>
> Any suggestions?
>
> Regards,
>
> Sven


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to