General discussions related to php

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Fri Feb 07, 2014 9:32 am


Postby Joak190867 » Fri Feb 07, 2014 9:41 am

Hello guys!, I'm newbie in PHP, so .... please help me!!!!

I have a QUERY and I want to put the records into Array ... I have spent 3 days and I can't continue with my code

function redeem() {
// Check for required parameters
if (isset($_POST["id_cliente"]) && isset($_POST["id_sucursal"])) {
// Put parameters into local variables
$cliente = $_POST["id_cliente"];
$sucursal = $_POST["id_sucursal"];
$stmt = $this->db->prepare('SELECT id_arbitro FROM arbitro WHERE id_cliente =? AND id_sucursal =?') or die(mysqli_error($this->db));
$stmt->bind_param("ii", $cliente, $sucursal);
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$cuantos = count($result);
echo "$cuantos";

$registros = 0;
//This doesn't work too
/*while ($stmt->fetch()) {
$registros ++;
// Return unlock code, encoded with JSON
$result = array("id_arbitro" => $stmt,);
echo "$id_arbitro !";
if ($registros < 0) {
sendResponse(400,"No existen arbitros con los parámetros recibidos");
return false;

//echo json_encode($result);
sendResponse(200, "FIN");
//printf("ERROR %s",$registros);
return true;
sendResponse(400, 'Invalid request');
return false;

Return to “PHP General”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests