Jump to content

I ask your help


spanish

Recommended Posts

Hello, this forum is great. I ask your help:

 

This is my problem:

 

I have one function in a file named funciones.php

 

function regresaFactura($idfactura){
$strSQL = "Select * from STtblFactura, STtblDetalleFactura where STtblFactura.intIDFactura=STtblDetalleFactura.intFKIDFactura and intIDFactura=$idfactura";
$DatosFactura=mysql_query($strSQL); // si hago un print aqui de $DatosFactura me lo hace
return $DatosFactura; // estaba mal escrito, pero esta bien en mi script
}

 

If in this file I make a print of $DatosFactura y have the correct result.

 

But if I call this function since another file imprimeFactura.php, like that:

 

include('funciones.php')
$vidfactura=$_GET['idfactura']; //This is from one form, and return a value
$resultadoFactura=regresaFactura($vidfactura); // 

Here I have one error if I make a print.

 

what's wrong, please.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/95252-i-ask-your-help/
Share on other sites

Add some debugging code to the function

<?php
function regresaFactura($idfactura){
$strSQL = "Select * from STtblFactura, STtblDetalleFactura where STtblFactura.intIDFactura=STtblDetalleFactura.intFKIDFactura and intIDFactura=$idfactura";
$DatosFactura=mysql_query($strSQL); // si hago un print aqui de $DatosFactura me lo hace

if (!$DatosFactura) echo mysql_error(), "<pre>$strSQL</pre>";

return $DatosFactura; // estaba mal escrito, pero esta bien en mi script
}

Link to comment
https://forums.phpfreaks.com/topic/95252-i-ask-your-help/#findComment-487931
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.