RE: SQL statement syntaxis

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

 



missing the singles quotes around the company name text element

$query_company_listing = "SELECT CompanyID, CompanyName,
CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
company WHERE company.CompanyName='".$_POST['CompanyName']."'  ORDER BY
CompanyName ASC";


bastien

From: jdiazkropman@xxxxxxxxxxx (PHPDiscuss - PHP Newsgroups and mailing lists)
To: php-db@xxxxxxxxxxxxx
Subject: SQL statement syntaxis
Date: 6 Jan 2005 19:12:16 -0000


Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.

The query (displayed below) works great without the
".$_POST['CompanyName']."

$query_company_listing = "SELECT CompanyID, CompanyName,
CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
company WHERE company.CompanyName=".$_POST['CompanyName']."  ORDER BY
CompanyName ASC";

But it messes up if I include it because the first " is considered as the
end of the previous one and so on. So the code gets messed up.

Any help will be greatly appreciated!
Have everybody a wonderful 2005!
Jorge

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


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux