Domanda

<code>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jQuery.pager.js Test</title>
    <link href="Pager.css" rel="stylesheet" type="text/css" />
    <script src="jquery-1.2.6.min.js" type="text/javascript"></script>
    <script src="jquery.pager.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">

        $(document).ready(function() {
            $("#pager").pager({ pagenumber: 1, pagecount: 15, buttonClickCallback: PageClick });
        });

        PageClick = function(pageclickednumber) {
            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: 15, buttonClickCallback: PageClick });
            $("#result").html("Clicked Page " + pageclickednumber);
        }

    </script>

</head>
<body>

$query = "select name from student";
$result = mysql_query(Query);
while($row=mysql_fetch_array($result)){
$student_name = $row['name'];
?>
<h1 id="result"><?php echo $student_name; ?></h1>
<? }
?>

<div id="pager" />
</body>
</html>
</code>

Per il mio codice di cui sopra non sono geting il nome dello studente, se mi tolgo la sceneggiatura cercapersone, apparirà il nome dello studente, si può sapere, perché, dove ho fatto errore ..

I cosa che devo passare somthing in html (), ma non sono sicuro ..

È stato utile?

Soluzione

while($row=mysql_fetch_array($result)){ $student_name = $row['name']; }

dovrebbe essere

$student_name = NULL;
while($row=mysql_fetch_array($result)){ $student_name .= $row['name']; }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top