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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.