1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
if($_GET[zipcode])
$sql= "WHERE prof_id = ".$_GET[prof_id]." AND zipcode LIKE '".$_GET[zipcode]."%'";
else
$sql= "WHERE prof_id = ".$_GET[prof_id];
if($page > page_num($sql)){ $page = 1;
$smarty ->assign("page",$page); }
$sql1 = "SELECT * FROM `job_list` ".$sql." LIMIT ".(($page-1)*MAXITEMS)." , ".MAXITEMS;
$result= mysql_query($sql1);
while($list = mysql_fetch_array($result)){
$job_list[] = $list;
//I add each item to an array to later pass through to the template.
}
//Assign the array I got from the sql to a variable in smarty for output.
$smarty ->assign("job",$job_list);
$smarty ->assign("zipcode",$_GET[zipcode]);
//Variable needed for output
$smarty ->assign("max_page",page_num($sql));
$smarty ->assign("prof_name",prof_name());
$smarty ->display("job_select.tpl");
La ligne 160 est celle du white:
while($list = mysql_fetch_array($result)){
$job_list[] = $list; |
Partager