Speak up.
I'm developing a portal geared towards music, the idea and give all the necessary information to the visitor about your favorite artist / band: like Band, Description, Website, Facebook and on the same page. A grid with all the news it.
In the development I created a tbl_post table with the fields:
id | status | session | category | cover | title | url | content | band | video | date | visits
id - unique for each post with auto increment status - 1 or 0 to inactivate the post session - shows whether it is a category or subcategory category - shows category cover - the cover of the post (THumbnail) title - the title url - the friendly url of the post content - I do not need to say rsrs band - band name video - url of video date - posting visits - account visits
And I also created a table called tbl_banda and I put the following fields in it:
id - unique id for band layer with auto increment vert - shows the musical style cover - the same cover band - band name band page url - url origin - I place the Country of Origin Facebook - twitter - Web site - description - date -
It's the following folks. I'm breaking my head for some time and worse, I feel it's something very primary that I'm doing wrong.
I'm having trouble relating the post to the band, I want it when I post a post and choose the band in the post. to the effect that the band field in the post table will not be used, regardless of the media used.
Below is the code to update the post, find a way to implement the information in the bands table through the post upgrade:
// Script in progress //
case 'post_atualiza':
sleep(1);
$postid = mysql_real_escape_string($_POST['postid']);
$c['titulo'] = mysql_real_escape_string($_POST['titulo']);
$c['categoria'] = mysql_real_escape_string($_POST['categoria']);
//LE E RECUPERA A SESSAO
$readSes = read('categorias',"WHERE id = '$c[categoria]'");
if($readSes): foreach($readSes as $ses); endif;
$c['sessao'] = $ses['sessao'];
$c['banda'] = mysql_real_escape_string($_POST['banda']);
$c['video'] = mysql_real_escape_string($_POST['video']);
$c['conteudo'] = mysql_real_escape_string($_POST['conteudo']);
$c['cadastro'] = mysql_real_escape_string($_POST['cadastro']);
$c['status'] = mysql_real_escape_string($_POST['status']);
$c['url'] = setUri($c['titulo']);
$c['cadastro'] = formDate($c['cadastro']);
$verificaURL = read('posts',"WHERE id != '$postid' AND url = '$c[url]'");
aqui fica o script das imgs,desnecessário para o assunto
---------------------------------------------------------
update('post',$c,"id = '$postid'");
break;