On Fri, 2003-10-03 at 16:44, Jeff McKeon wrote:
> Actually, here's the problem I get with using global variables in a
> mysql_query string..
> 
> [error begin]
> PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> expecting T_STRING or T_VARIABLE or T_NUM_STRING 
> [error end]
> 
> [code begin]
> $query="SELECT * from tickets where VesselID='$_GET['vesselid']' order
> by Status DESC, Created ASC";
> [code end]

The following will work:

$query=
    "SELECT * "
   ."FROM tickets "
   ."WHERE VesselID='".$_GET['vesselid']."' "
   ."ORDER BY Status DESC, Created ASC";

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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

Reply via email to