• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC PHP pull data from 2 columns

Beo

Three Magic
Joined
Aug 25, 2009
Messages
9,053
Solutions
1
Reaction score
844
Having issues with pulling data from 2 columns. It's been a while since I've touched PHP so I thought I'd ask here!

What I need to achieve:
Table A has 2 columns, attr_type and city.

I need to display, where attr_type = 'acc' and city variable, then display based on city.

For example, I click on CityA and it will display any information with the field column CityA

attr_typecity
accthais
accvenore

so, if i click on Venore page, it will show any data with the attr_type acc and the city venore.
if I click Thais page, it will show any data with the attr_type acc and the city thais.

sounds easy right?

here comes the catch

I can add city pages as many as I want, with a different page, with different names, so if I was to add Edron through my "add city" page, I need the SQL statement to automatically search Edron, too, without adding it manually as a OR statement. If that makes sense?

Good god, I've butchered my explanation!
Anyway, this is the SQL code I have

SQL:
$result = mysqli_query($con,"SELECT * FROM table WHERE attr_type = 'ACC' AND city_name = 'THAIS');

but I need to change the city_name to a variable... thanks!
 
Back
Top