如何在pageload上显示mysql数据库中的选定结果

时间:2017-02-08 23:18:05

标签: php mysql

。如何在页面加载时显示来自MySQL数据库的选定结果例如,如果页面加载,我希望所有发布的作业自动显示而不是单击时

//////////////////////////////////////////
// VIEW SEARCHED JOBS
//////////////////////////////////////////
function viewSearchedJobs() {
  connectDatabase();

  $pk = mysql_real_escape_string($_GET['pk']);
  if (isset($_GET['start']))
    $start = $_GET['start'];
  else
    $start = 0;
  $result = queryDatabase("SELECT total, fk_job
                           FROM search
                           WHERE pk = $pk");
$row = mysql_fetch_object($result);

  $total = $row->total;

  if ($total > 0) {
    $results = (($start + 20) > $total) ? $total: ($start + 20);

    echo "<div class=\"good\">Results " . ($start + 1) . "-$results of $total job(s) found</div><br />";
  } else
    echo "<div class=\"bad\"><b>Sorry...Your search did not match any jobs in our database.</b></div><br />";

  ...............................................

This is the page where I want the results to be displayed

<div id="results_box"/>
<font face="Just+Another+Hand" font color="#111111"/><b>Job Results: <br></b></font>
<p>
<iframe id="my-iframe" name="my-iframe"src="http://jobalooza.com/browse.php?" frameborder="0" scrolling="no" height="1500px" width="720px"  ></iframe>
</div>

0 个答案:

没有答案