javascript - Dont display all data you get from database at start -
i using simple script fetch data database, looks like:
public function fetchbyvinevidence() { $success = false; try{ $con = new pdo( db_host, db_user, db_pass ); $con->setattribute( pdo::attr_errmode, pdo::errmode_exception ); $sql = "select * evidence_calculations vin = :vin limit 5"; $stmt = $con->prepare( $sql ); $stmt->bindvalue( "vin", $this->vin, pdo::param_str ); $stmt->execute(); while ($row = $stmt->fetch()){ echo "<tr>"; echo "<td>#4</td>"; echo "<td>".$row['street']."</td>"; echo "<td>".$row['city']."</td>"; echo "<td>".$row['claim_number']."</td>"; echo "<td>".$row['country']."</td>"; echo "<td><a href =\"javascript:void(0)\" onclick = \"document.getelementbyid('light').style.display='block';document.getelementbyid('fade').style.display='block'\">detail</a></td>"; echo "</tr>"; } }catch(pdoexeption $e){ echo $e->getmessage(); echo $con->errorinfo(); } return $success; }
it works cool, u can see on bottom making js open window detail need display more info database not
claim_number, city. street , country. can write new function rest of data need in detail big database , take time data wonder if can fetch data @ start of them display when click on detail
using function:
<?php $data = new data; $data->storeformvalues( $_post ); $data->fetchbyvinevidence(); ?> <div id="light" class="white_content">this lightbox content. <a href = "javascript:void(0)" onclick = "document.getelementbyid('light').style.display='none';document.getelementbyid('fade').style.display='none'">close</a></div> <div id="fade" class="black_overlay"></div>
can me guys?
Comments
Post a Comment