/******************************************** * ----- * Author: John van den Berg * ----- * Description: */ function nas_mysql_result($dbhost,$dbuserlogin,$dbpassword,$dbname,$dbsql,$rstype) { $dbconn = mysql_connect($dbhost,$dbuserlogin,$dbpassword) or die("Server Unavailable"); mysql_select_db($dbname,$dbconn) or die("Database Unavailable"); $result = mysql_query($dbsql) or die("Query Unavailable"); //-- initial value -- $iRows = 0; $iCols = 0; $iRows = mysql_num_rows($result); $iCols = mysql_num_fields($result); settype($arrContents,"array"); switch ($rstype) { case "byindex": for($row=0; $row<$iRows; $row++){ $rs = mysql_fetch_row($result); for($col=0; $col<$iCols; $col++){ $arrContents[$row + $limit1][$col] = $rs[$col]; }; }; return $arrContents; break; case "byname": for($row=0; $row<$iRows; $row++){ $rs = mysql_fetch_row($result); for($col=0; $col<$iCols; $col++){ $arrContents[$row][mysql_field_name($result,$col)] = $rs[$col]; }; }; return $arrContents; break; }; mysql_free_result($result); mysql_close($dbconn); }; $dbhost = "localhost"; $dbuserlogin = "buypag"; $dbpassword = "3vwvB3^2"; $dbname = "buypage4posters_com_-_test"; $AID = "423799127"; $categorie_id = $_GET[cat_id]; $head_count=0; $iRows = 1; settype($head_array,"array"); while($iRows > 0){ if($head_count==0) { //$dbsql_head = "select cat1.categorie_id, cat1.hoofd_categorie_id, cat1.titel from categorie as cat1 left join categorie as cat2 on cat1.categorie_id = cat2.hoofd_categorie_id where cat2.categorie_id = ".$categorie_id; $dbsql_head = "select cat1.categorie_id, cat1.hoofd_categorie_id, cat1.titel from categorie as cat1, categorie2 as cat2 where cat1.categorie_id = cat2.hoofd_categorie_id and cat2.categorie_id = ".$categorie_id; }else { //$dbsql_head = "select cat1.categorie_id, cat1.hoofd_categorie_id, cat1.titel from categorie as cat1 left join categorie as cat2 on cat1.categorie_id = cat2.hoofd_categorie_id where cat2.categorie_id = ".$head_array[$head_count-1][0]; $dbsql_head = "select cat1.categorie_id, cat1.hoofd_categorie_id, cat1.titel from categorie as cat1, categorie2 as cat2 where cat1.categorie_id = cat2.hoofd_categorie_id and cat2.categorie_id = ".$head_array[$head_count-1][0]; } $dbconn_head = mysql_connect($dbhost,$dbuserlogin,$dbpassword) or die("Server Unavailable"); mysql_select_db($dbname,$dbconn_head) or die("Database Unavailable"); $result1 = mysql_query($dbsql_head); if (!$result1) { echo 'Could not run query: ' . mysql_error(); exit; } $iRows = mysql_num_rows($result1); $iCols = mysql_num_fields($result1); for($row=0+$head_count ; $row<$iRows+$head_count; $row++){ $rs = mysql_fetch_row($result1); for($col=0; $col<$iCols; $col++){ $head_array[$row][$col] = $rs[$col]; }; }; mysql_free_result($result1); mysql_close($dbconn_head); $head_count++; } $dbsql_categorie_name = "select titel from categorie where categorie_id = ".$categorie_id; $categorie_name = nas_mysql_result ($dbhost,$dbuserlogin,$dbpassword,$dbname,$dbsql_categorie_name,"byindex"); echo ""; echo "
"; echo "| Navigation from '.$categorie_name[0][0].' | '; echo "|
| '; echo " |
| '; echo ' | '.$subc_array[$i][1].' | '; // echo ''.$subc_array[$i][1].' | '; $i++; echo ''; echo ' | '.$subc_array[$i][1].' | '; $i++; echo ''; echo ' | '.$subc_array[$i][1].' | '; $i++; echo ''; echo ' | '.$subc_array[$i][1].' | '; echo '
| '.$a->previousNext().' Total Pages:'.$tot_pages; //echo ''; echo ' | ";
echo "
'; echo ''.$myarray[$i][20].' '; echo ''.$myarray[$i][14].' x '.$myarray[$i][11].' inches '; //Size echo "$ ".number_format($myarray[$i][9], 2, '.', '')." "; echo 'Buy now '; if($myarray[$i][1]=="Y") { echo 'unframed '; echo 'framed '; }; if($myarray[$i][2]=="Y") { echo 'mounted '; }; echo " | ";
$i++;
echo ''; echo ''.$myarray[$i][20].' '; echo ''.$myarray[$i][14].' x '.$myarray[$i][11].' inches '; echo "$ ".number_format($myarray[$i][9], 2, '.', '')." "; echo 'Buy now '; if($myarray[$i][1]=="Y") { echo 'unframed '; echo 'framed '; }; if($myarray[$i][2]=="Y") { echo 'mounted '; }; echo " | ";
$i++;
echo ''; echo ''.$myarray[$i][20].' '; echo ''.$myarray[$i][14].' x '.$myarray[$i][11].' inches '; echo "$ ".number_format($myarray[$i][9], 2, '.', '')." "; echo 'Buy now '; if($myarray[$i][1]=="Y") { echo 'unframed '; echo 'framed '; }; if($myarray[$i][2]=="Y") { echo 'mounted '; }; echo " | ";
$i++;
echo ''; echo ''.$myarray[$i][20].' '; echo ''.$myarray[$i][14].' x '.$myarray[$i][11].' inches '; echo "$ ".number_format($myarray[$i][9], 2, '.', '')." "; echo 'Buy now '; if($myarray[$i][1]=="Y") { echo 'unframed '; echo 'framed '; }; if($myarray[$i][2]=="Y") { echo 'mounted '; }; echo " | ";
echo "
