Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am relitively new to php and I have a task to add pagination to this results page of actors category search . Try as I may I cant seem to intergrate the page snippets into the code . Can anyone help . Here is the page it uses the do..while loop to get the results . I think this may be the problemCode: Select all
<?php
require_once('dbconn.php');
$sex=$_POST['sex'];
$hair=$_POST['hair'];
$eyes=$_POST['eyes'];
$look=$_POST['look'];
$location=$_POST['location'];
$minAge=$_POST['minAge'];
$maxAge=$_POST['maxAge'];
$minheight=$_POST['minheight'];
$maxheight=$_POST['maxheight'];
mysql_select_db($database_dbconn, $dbconn);
$sql= "SELECT * FROM actors where act_id >'0' ";
if (isset($_POST['actor'])){ $sql.="&& actor ='yes' "; }
if (isset($_POST['presenter'])){ $sql.="&& presenter ='yes' "; }
if (isset($_POST['dancer'])){ $sql.="&& dancer = 'yes' "; }
if (isset($_POST['singer'])){ $sql.="&& singer = 'yes' "; }
if (isset($_POST['voiceover'])){ $sql.="&& voiceover ='yes' "; }
if ((isset($sex))&&($sex!='-')){ $sql.="&& sex = '".$sex."' "; }
if ((isset($hair))&&($hair!='-')){ $sql.="&& hair = '".$hair."' "; }
if ((isset($look))&&($look!='-')){ $sql.="&& look = '".$look."' "; }
if ((isset($eyes))&&($eyes!='-')){ $sql.="&& eyes = '".$eyes."' "; }
if ((isset($location))&&($location!='-')){ $sql.="&& location = '".$location."' "; }
if (!empty($minAge)){ $sql.="&& minAge <= '".$minAge."'"; }
if (!empty($_POST['maxAge'])){ $sql.="&& maxAge >= '".$_POST['maxAge']."'"; }
if (!empty($minheight)){ $sql.="&& height >= '".$minheight."'"; }
if (!empty($_POST['maxheight'])){ $sql.="&& height <= '".$_POST['maxheight']."'"; }
$actors=mysql_query($sql,$dbconn) or die(mysql_error());
$row_actors=mysql_fetch_assoc($actors);
$totalRows_Actors = mysql_num_rows($actors);
do {
{
echo '<a href="details.php?act_id='.$row_actors['act_id'].'" target="_blank">';
}
echo '<img border="0" width="63" height="90" alt="'.$row_actors['firstname']." ".$row_actors['surname'].'"" src=update_folder/photoTH/'.$row_actors['photoTH'].'>';
{
echo '</a>';
}
} while ($row_actors=mysql_fetch_assoc($actors));
?>feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]