Vote count:
0
i am working on image site where, images belongs to the specific categories,
there are 70+ category types/name (i.e. books,trees,people,watches,cars,mobiles etc) as of now and will be near about 80-90 categories in near future , and each category has meta description, meta keywords , title specific to that category.
my question is where should i store this data ?
- in php using 3-4 types of array and then using array lookup to find and show the meta data specific to that directory ?
e.g.
$meta_description = array('books' => 'books meta description', 'trees' => 'trees meta description')
and then doing
if(isset($meta_description[$_GET['category']])){
echo $meta_description[$_GET['category']]);
}
- in MySQL db table and then doing mysql query on each page load for getting meta description, title data from db ?
e.g.
table
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| cat_name | varchar(50) | NO | MUL | | |
| title | varchar(100) | NO | | NULL | |
| metakw | varchar(100) | NO | | NULL | |
| metadesc | varchar(100) | NO | | NULL | |
| record_num | tinyint(2) | NO | PRI | NULL | auto_increment |
+------------+--------------+------+-----+---------+----------------+
and then getting info using mysql query on each page load.
i am looking for high performance as there are 20+ million records in the main table and there are already lots of mysql queries are fired every second, so i am lloking to lower the mysql burden .
asked 2 mins ago
Which is better for storing Meta-description of categories , php var or mysql db
Aucun commentaire:
Enregistrer un commentaire