Skip to content
Advertisement

displaying values from sql in html select option not displaying values

i have created a html form using php and sql. The form contains a field called spaces which is a select dropdown. The values are coming from an array which i declared in php. If the values in array are already present in database it should not display. So i have done the following code:

but this is not making any values display. Can anyone please tell me what is wrong in my code. thanks n advance

Advertisement

Answer

you are comparing a string with the array. you should use in_array like this

update the code

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement