How to get column data from a database with column name?

I want to get data from the database, but the database shows only one column name "image URL", so I get error.after it removes this column name from the query, than I received data.can someone help me how to get data from this column whose column name has a space.

my request

$res = mysqli_query( $con ,"select p_name,price,image URL,description from product where p_name REGEXP '$kws'"); 

when I remove the image url from this request, I got the result. I am using phpMyadmin.

I also tried the "image url", but the result suddenly appeared.

+3
source share
2 answers

around him using backward measures

 $res = mysqli_query( $con ,"select p_name,price,`image URL` as imgurl ,description from product where p_name REGEXP '$kws'"); 

Note:

, image_URL imageURL, -, .

EDIT:

+3

`image URL`

$res = mysqli_query( $con ,"select p_name,price,`image URL`,description from product where p_name REGEXP '$kws'");
0

All Articles