I just want to learn this, I have $country_name variable in my code and if $country_name=turkey, I need to create a table in database as turkey_ip because of this I wrote below code and it works good. But I wonder is there a way to not create $_ip variable. I mean I want to use $country_name variable and _ip string in mysql query so ı do not need one extra variable.
mysql_query("CREATE TABLE $_ip (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
Generally speaking, I probably would not recommend creating a separate table. Instead, use one table, and include in it a column for 'country' in this case, or probably to be even better normalized, a key to a row in a separate table that is just a country list. Then if you create an index on that column, it's a snap to get all entries for a given country from the single table (as opposed to ending up with dozens, maybe hundreds of separate tables, each with the same basic purpose.