Jump to content

meta description help


cerberus478

Recommended Posts

Hi I have the following code, this code is suppose to get the data from the galleries table and the pages table. I think my problem is the sql statement but I'm not sure.

 

public function galleries(){

foreach($this->_params['list'] as $gallery){
			$id = $gallery['id'];
			$name = $gallery['name'];


	$select = "SELECT * FROM pages, galleries 
				WHERE pages.name = {$gallery['name']}";


	$this->_params['item'] = $this->_model->get(array("pages.name = 'galleries.name'"));
   }

 

the code

$this->_params['item'] = $this->_model->get(array("pages.name = 'galleries.name'"));

 

works just fine with the home page and all the other pages.

 

I have 2 galleries called gallery 1 and gallery 2, now my problem is that I need the sql to go through the galleries table look for the name and then look through the pages table and get the meta data from the same name. There is no foreign id because I only need it for the galleries and nothing else.

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/247411-meta-description-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.