Re: SQL statement syntaxis
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Fri, 07 Jan 2005 04:13:39 +0000 |
| Subject: | Re: SQL statement syntaxis | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38054@lists.php.net to get a copy of this message | ||
Hello everybody,
I just want to thank you all for your help!!
I got three emails helping me out. The problem was that I wasn't including
the ' around the ".
When I typed '".$_POST['CompanyName']."' it worked great!
Thank you!!
Jorge
PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> 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