Re: PHP mysql stored procedure execution problem
Hi everyone,
Every time I call a stored procedure I lost my connection to the server.
//
// o prĂ³prio strtodate :p
$placa = $_SESSION['tomada']['placa'];
$data = preg_replace( '/(\d+)\/(\d+)\/(\d+)/i' , '$3-$2-$1' , $_REQUEST[ 'dt_lancamento' ] );
$km = intval($_REQUEST['km_tomada']);
/*--------------------------------------------------------------------*/
if( ! $result = $mysqli->query( "CALL spcveiculonovatomadakm(\"$placa\", \"$data\", $km);" ) )
{
printf("cadastrando na spc :: Error: %s\n", mysqli_error($mysqli));
exit(0);
}
$_SESSION['mensagem'][] = "CALL spcveiculonovatomadakm(\"$placa\", \"$data\", $km);";
while ($row = $result->fetch_array())
{
$_SESSION['mensagem'][] = $row[0];
}
/*--------------------------------------------------------------------*/
/* I allways have to reconect to my server after calling a stored procedure */
unset($mysqli);
$mysqli = new mysqli("localhost", "root", "-", "desenv");
$_SESSION['tomada']['historico'] = array();
$sql = "SELECT * FROM vveiculotomadahistorico WHERE nr_placa = '";
$sql .= $_SESSION['tomada']['placa'];
$sql .= "';";
if ($result = $mysqli->query( $sql ))
{
while ($row = $result->fetch_assoc())
{
$row['dt_tomada'] = strtotime($row['dt_tomada']);
$_SESSION['tomada']['historico'][] = $row;
}
}
else
{
printf("gerando a lista :: Error: %s\n", mysqli_error($mysqli));
exit(0);
}
// $myresult->free();
/*--------------------------------------------------------------------*/
Subject
Views
Written By
Posted
5378
August 12, 2005 07:44AM
4623
August 12, 2005 08:27AM
3081
August 12, 2005 10:56PM
3028
August 13, 2005 05:03AM
3268
September 15, 2005 01:06AM
3032
September 15, 2005 10:13AM
Re: PHP mysql stored procedure execution problem
3965
October 03, 2005 08:57AM
6839
October 11, 2005 07:22AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.