RE: Query Returning Error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Besides adding $ to Query01, I have had little luck in the past when  using
$_POST or $_GET directly in an evaluated string. If you are still having
problems, try something like:

<?php
$user = $_POST['TXT_UserID'];
$pwd = $_POST['TXT_UserPassword'];

// Authenticate User:
   $Query01 = "SELECT * FROM Users
               WHERE UserID='$user' AND
                     UserPassword='$pwd'";
   $Result01 = mysql_query($Query01) or die("Error 01: " . mysql_error());
?>

HTH

Graham

> -----Original Message-----
> From: Harlequin [mailto:michael.mason@xxxxxxxxxxxxxxxxx]
> Sent: 13 October 2004 08:32
> To: php-general@xxxxxxxxxxxxx
> Subject:  Query Returning Error
>
>
> Morning all.
>
> this is such a basic question I'm embarrassed to ask but the query worked
> fine a few minutes ago and now returns an error:
>
> I get an error:
>
> Parse error: parse error, unexpected '=' in sample.php on line 2
>
> [CODE]
> // Authenticate User:
>    Query01 = "SELECT * FROM Users
>    WHERE UserID='$_POST[TXT_UserID]'
>    AND UserPassword='$_POST[TXT_UserPassword]'";
>    $Result01 = mysql_query($Query01) or die("Error 01: " . mysql_error());
> [/CODE]
>
> WTF...?
>
> --
> -----------------------------
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -----------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux