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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.