'; $model_name = ''; } //$model_id='1'; //$make='sharpp'; // connect to db include_once ("includes/connectdb.php"); //convert model_id to make and model $sql2="SELECT printer_model.model_id, printer_make.make_name, printer_model.model_name FROM `printer_model` JOIN printer_make ON printer_model.make_id=printer_make.make_id WHERE model_name='$model_name'"; //-------------- #$result2=mysql_query($sql2) or die(mysql_error()); $result2=mysqli_query($c,$sql2) or die(mysql_error()); //if (mysql_num_rows($result2) < 1) { if (mysqli_num_rows($result2) < 1) { //there are none, so say so $display_block = "

There was an issue.

"; } else { //while ($row2=mysql_fetch_array($result2)) { while ($row2=mysqli_fetch_array($result2)) { $model_id=$row2["model_id"]; $make=$row2["make_name"]; $model=$row2["model_name"]; } //add count views $sql="UPDATE printer_model SET printer_model.model_views = printer_model.model_views + 1 WHERE printer_model.model_id='$model_id'"; //$result=mysql_query($sql) or die(mysql_error()); $result=mysqli_query($c,$sql) or die(mysql_error()); //-------------- $makemodeltitle = "Default Password for ".$make . " " . $model; //echo $model_id." ".$make . " " . $model; } //--------------- //pull list of passwords $sql="SELECT printer_pass.pass_id, printer_pass.user_value, printer_pass.pass_value, printer_pass.vote_value FROM printer_pass WHERE printer_pass.model_id='$model_id' ORDER BY printer_pass.vote_value DESC"; //$result=mysql_query($sql) or die(mysql_error()); $result=mysqli_query($c,$sql) or die(mysql_error()); //if (mysql_num_rows($result) < 1) { if (mysqli_num_rows($result) < 1) { //there are none, so say so $display_block = "

We do not have any listings for this device.

"; } else { //create the display string $display_block = " "; //while ($row=mysql_fetch_array($result)) { while ($row=mysqli_fetch_array($result)) { $user=$row["user_value"]; $pass=$row["pass_value"]; $vote=$row["vote_value"]; $display_block .= " "; } //close up the table $display_block .= "
UsernamePassword
$user$pass$vote
"; } ?> <? echo "$makemodeltitle";?>