0

In my database, I have a table with a column Customer Name. When I use select statement like

select * 
from data 
where Customer Name = '".$uname."' 
limit 1

it does not work because of the SPACE between "Customer" and "Name".

But when I write

select * 
from data 
where CustomerName = '".$uname."' 
limit 1

and change column name in the database table, the problem is solved.

How can I solve this with out renaming column name in DB?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    [Why should I tag my DBMS](https://meta.stackoverflow.com/questions/388759/) in standard SQL you would use double quotes: `"Costumer Name"` –  Nov 21 '21 at 14:30
  • 1
    And you most likely also mean a **customer** - not a "costumer" .... – marc_s Nov 21 '21 at 14:33

0 Answers0