James is right .... $prodvar is not set. I set it in a URL on the page before. 
Which is how it 
needs to happen, as it is set when the user clicks the link in a list of 
choices. That link sets 
the variable for the next page which brings up the results of the query I'm 
having the 
problems with.

In the code on the previous page, I said:

<a href="productions.php?prodvar='.$shows["showid"].'">

This has worked beautifully in the past on my previous two hosts. Is there a 
better way?

Regarding the version of PHP: 

New host has: 4.3.11
Old host has: 4.4.1

The old host has more listed under configure command than the new one.

The new host has CGI/FastCGI listed for Server API with the old host listing 
Apache.

Jeremy


--- In [email protected], James Keeline <[EMAIL PROTECTED]> wrote:
>
> --- whoisquilty <[EMAIL PROTECTED]> wrote:
> > You have an error in your SQL syntax. Check the manual that corresponds to
> > your MySQL server version for the right syntax to use near 'ORDER BY 
> > yearopen' at line 4
> > 
> > Looking at my code:
> > 
> > "SELECT *
> >     FROM productions
> >     WHERE showno = $prodvar
> >     ORDER BY yearopen";
> > 
> > ...the Where statement is the problem. If I remove the Where statement, it
> > works fine. I tried the previous suggestion of putting $prodvar as 
> > '$prodvar' or ".$prodvar." Neither worked. '$prodvar' returned no results. 
> > And ".$prodvar." gave me the same error as above.
> 
> It sounds like your variable $prodvar is empty, not set.  Before making your
> database call, print out the variable $prodvar to see what it contains.
> 
> The reason that '$prodvar' works -- doesn't generate an error -- is that it is
> valid SQL with an empty value for $prodvar.  Your other methods break the SQL
> because it effectively reads as:
> 
>  "SELECT *
>       FROM productions
>       WHERE showno = 
>       ORDER BY yearopen";
> 
> You now need to figure out why this variable does not have an expected value.
> 
> James Keeline
>


Reply via email to