raven2009 Posted May 8, 2009 Share Posted May 8, 2009 right ill try and make this easy to understand im not good at explaining things when i make a new store page its gets a new id e.g. store.php?id=254 now when i index the pages via google it comes up with the name of the main stores name e.g my site name - stores and thats displays a few hundred times how do i get it to display individual names of stores in the meta name (top of page) e.g my site name - Auto trader Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/ Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 Is Auto trader stored in the database? If so, you can just query it and echo it out in that spot. Got a code you need help with or can you solve this yourself? Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/#findComment-829928 Share on other sites More sharing options...
raven2009 Posted May 8, 2009 Author Share Posted May 8, 2009 yes it's stored in the database so what your saying is put the stored database name in the meta? so how would i implement that have you got a basic code, im not sure what your after for the code tanks for your reply Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/#findComment-829933 Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 Something like this: blah.php <?php $meta_name = ''; $id = intval($_GET['id']); if (!empty($id)) { $sql = 'SELECT meta FROM tablename WHERE id=' . $id . ' LIMIT 1'; $result = mysql_query($sql); $result = mysql_fetch_assoc($sql); $meta_name = $result['meta']; } ?> <html> <head> <meta name="description" content="<?php echo $meta_name; ?>" /> </head> <body> </body> </html> There's an example. Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/#findComment-829938 Share on other sites More sharing options...
raven2009 Posted May 8, 2009 Author Share Posted May 8, 2009 Something like this: blah.php <?php $meta_name = ''; $id = intval($_GET['id']); if (!empty($id)) { $sql = 'SELECT meta FROM tablename WHERE id=' . $id . ' LIMIT 1'; $result = mysql_query($sql); $result = mysql_fetch_assoc($sql); $meta_name = $result['meta']; } ?> <html> <head> <meta name="description" content="<?php echo $meta_name; ?>" /> </head> <body> </body> </html> There's an example. thanks for that heres a sample of my code trouble is the id is just a number would i replace id with retailer name? thanks for your help $id=$_GET['id']; $retailers="select * from retailers where id='$id'"; $listRetailers=mysql_query($retailers); while($row=mysql_fetch_array($listRetailers)) { $id=$row['id']; $retailername=$row['retailername']; $category=$row['category']; $keywords=$row['keywords']; Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/#findComment-829942 Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 I guess. I'm not sure what data your DB has, but give it a try. Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/#findComment-829947 Share on other sites More sharing options...
raven2009 Posted May 8, 2009 Author Share Posted May 8, 2009 I guess. I'm not sure what data your DB has, but give it a try. yesssssss i did it i did the information you told me but it displayed just the retailer number so i added <?php echo $retailername; ?> in to the title and it worked i'm well happy Thanks for your supprt Quote Link to comment https://forums.phpfreaks.com/topic/157432-solved-displaying-individual-store-names-in-meta-name/#findComment-829955 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.