Since the first query works, the second one should also work as it is
virtually the same. It is querying the same database using the exact
same query. The only difference is the variable names passed to it by
the form.

i.e. 

$playerfrom may = Hossa
$playerto may = Alfredsson
$namefrom may = Bill
$nameto may = John

If I change the from and the to values to the opposite of the above
example I get the same thing. The second query does not work (which
works if I use it as the first query). Even if I use the exact same
query for both - the second one will not work.

Hope this makes sense..... 

-----Original Message-----
From: Jef S [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2003 12:50 PM
To: [EMAIL PROTECTED]
Subject: RE: MySQL query problems


Have you checked the query in an editor to see if they are working? Just
substitute known values in the place of the variables you are using.


Jef

> -----Original Message-----
> From: C. Reeve [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2003 10:16 AM
> To: [EMAIL PROTECTED]
> Subject: MySQL query problems
> 
> 
> Hi,
> 
> Not sure if the problem here is PHP or MySQL, but here we go. I am 
> trying to do two queries on a database - one after the other, but the 
> second one never seems to get executed. The two queries are identical 
> except for two variables. I have checked my form and they are correct 
> and are being sent to the PHP script the way they should be.
> 
> The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO'

> query is the one that doesn't work.
> 
> Here is my code. Any help is appreciated.
> 
> if ($namefrom != $nameto) {
>       if ($playerfrom != $playerto) {
> 
>               include("2004server.inc");
>               if($error) {
>                       include("trades-input.php");
>               exit;
>               }
> 
>               $query1 = "select manager.idn, manager.total,
> roster.idp, position, points from roster join reference
>               join manager where manager.idn=reference.idn and 
> reference.idp=roster.idp and manager.idn like '$namefrom' and
>               roster.idp like '$playerfrom'";
> 
>               $result1 = mysql_query($query1) or $mysqlerror =
mysql_error();
>               if ($mysqlerror) {
>                   $error = "$d_base_error$email_error";
>                       include("trades-input.php");
>                       exit;
>               }
> 
>               $line = mysql_fetch_row($result1);
> 
>               mysql_free_result($result1);
> 
>               $query2 = "select manager.idn, manager.total,
> roster.idp, position, points from roster join reference
>               join manager where manager.idn=reference.idn and 
> reference.idp=roster.idp and manager.idn like '$nameto' and
>               roster.idp like '$playerto'";
> 
>               $result2 = mysql_query($query2) or $mysqlerror =
mysql_error();
>               if ($mysqlerror) {
>                   $error = "$d_base_error$email_error";
>                       include("trades-inputs.php");
>                       exit;
>               }
> 
>               $row = mysql_fetch_array($result2);
> 
>               mysql_free_result($result2);
>       }
> }
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to