Esempio n. 1
0
 /**
  * find_example
  * 
  * @uses uses of mysql find
  * @return array
  */
 public function find_example()
 {
     $data = mysql::find(array('conditions' => 'your conditions refer mysql class for more details'));
     return array('type' => 'success', 'data' => $data);
 }
Esempio n. 2
0
function prizenum($jpid)
{
    $db = new mysql(HOST, USERNAME, PASSWORD, DBNAME, 'lottery_jp');
    $data['id'] = $jpid;
    $cjnum = $db->find($data);
    return $cjnum[0]['num'];
}
Esempio n. 3
0
<?php

require_once 'classes/classe_bancodados.inc';
$bd = new mysql('localhost', 'root', '', 'cake');
$resultado = $bd->find('articles', 'title', 'aluno', true);
$posicao = isset($_GET['posicao']) ? $_GET['posicao'] : 0;
if (isset($_GET['posicao'])) {
    $resultado = array($posicao => $bd->navega($posicao));
}
//	var_dump($resultado);
//	die;
if (isset($_GET['acao']) && $_GET['acao'] == "editar") {
    include 'exemplo_2_6_form.php';
} else {
    ?>

	<html>
	<table>
	<thead>
		<title>	Resultados BD </title>
			<tr>
				<td> ID: 	</td>
				<td> Title:	</td>
				<td> Body:	</td>
				<td> Editar:	</td>
				<td> Deletar:	</td>				
			</tr>	
	</thead>
	<tbody>
<?php 
    foreach ($resultado as $pos => $item) {