----- Original Message ----- 
From: "whoisquilty"

I switched web hosts and I'm trying to get everything up and going. But, the
queries that had
worked before, don't work anymore.

If there is a variable passed, it doesn't work:

"SELECT *
FROM productions
WHERE showno = $prodvar
ORDER BY yearopen";

If I put the variable that $prodvar is set to in the query instead of
$prodvar, it works fine. So,
why is this wrong on a different server?

Thanks for the help.

Jer
----------------------------
You have not mentioned the versions of mySQL and PHP.

I would sugest that you now have an older version of PHP that doesn't parse
srtings in mysql_query() to insert variable values.

Do it this way to test -
$query = "SELECT *
FROM productions
WHERE showno = $prodvar
ORDER BY yearopen";
 or
$query = "SELECT *
FROM productions
WHERE showno = " . $prodvar . " ORDER BY yearopen";

$result = mysql_query($query);

Another possable problem is that you have no space ' ' between $prodvar and
ORDER only a \n and \n's are ignored.


Reply via email to