fixed id bug

git-svn-id: http://yolanda.mister-muffin.de/svn@121 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-10-22 12:17:01 +00:00
parent a840ef5c03
commit b30e62b40d

View file

@ -25,7 +25,7 @@ if($query->param('title') or $query->param('id'))
if($query->param('id')) if($query->param('id'))
{ {
#if id is passed ignore title and check for the id #if id is passed ignore title and check for the id
$sth = $dbh->prepare(qq{select id, title, description, userid, from_unixtime( timestamp ), $sth = $dbh->prepare(qq{select title, description, userid, from_unixtime( timestamp ),
creator, subject, contributor, source, language, coverage, rights, license creator, subject, contributor, source, language, coverage, rights, license
from videos where id = ? }) or die $dbh->errstr; from videos where id = ? }) or die $dbh->errstr;
$rowcount = $sth->execute($query->param('id')) or die $dbh->errstr; $rowcount = $sth->execute($query->param('id')) or die $dbh->errstr;
@ -33,7 +33,7 @@ if($query->param('title') or $query->param('id'))
else else
{ {
#if no id was passed there has to be a title we search for #if no id was passed there has to be a title we search for
$sth = $dbh->prepare(qq{select id, title, description, userid, from_unixtime( timestamp ), $sth = $dbh->prepare(qq{select title, description, userid, from_unixtime( timestamp ),
creator, subject, contributor, source, language, coverage, rights, license creator, subject, contributor, source, language, coverage, rights, license
from videos where title = ? }) or die $dbh->errstr; from videos where title = ? }) or die $dbh->errstr;
$rowcount = $sth->execute($query->param('title')) or die $dbh->errstr; $rowcount = $sth->execute($query->param('title')) or die $dbh->errstr;
@ -43,7 +43,7 @@ if($query->param('title') or $query->param('id'))
#if there was a title passed, then perform a search #if there was a title passed, then perform a search
if($rowcount == 0 and $query->param('title')) if($rowcount == 0 and $query->param('title'))
{ {
$sth = $dbh->prepare(qq{select id, title, description, userid, from_unixtime( timestamp ), $sth = $dbh->prepare(qq{select title, description, userid, from_unixtime( timestamp ),
creator, subject, contributor, source, language, coverage, rights, license creator, subject, contributor, source, language, coverage, rights, license
from videos where match(title, description, subject) against( ? ) }) or die $dbh->errstr; from videos where match(title, description, subject) against( ? ) }) or die $dbh->errstr;
$rowcount = $sth->execute($query->param('title')) or die $dbh->errstr; $rowcount = $sth->execute($query->param('title')) or die $dbh->errstr;