Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olah todo mundo, tudo bem com vcs?Bom, toh precisando de uma ajuda no codigo abaixo<head><title>Estoque</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript" type="text/JavaScript"><!--function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);//--></script></head> <body bgcolor="#FFFFFF"> <table width="28%" border="1" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF"> <tr bgcolor="#CCFFFF"> <td width="33%" height="22"><div align="center"><b>Material</b></div></td> <td width="36%" height="22"><div align="center"><b>Localização</b></div></td> <td width="31%" height="22"><div align="center"><b>Qtd Saldo </b></div></td> <td width="31%"><div align="center"><strong>Descr</strong></div></td> <td width="31%"><div align="center"><strong>Refer</strong></div></td> </tr> <?php //connect to the database $connectionstring = odbc_connect("Regency", "", ""); $id1 = $_POST["codfameq"]; //SQL query $Query = "SELECT BRET4002.Mat,BRET4002.Localiz,BRET4002.Qtd_Saldo,PARAM006.Juncao,PARAM006.Descr,PARAM006.Refer from (BRET4002 INNER JOIN PARAM006 ON BRET4002.Localiz = PARAM006.Juncao) WHERE BRET4002.Mat = '$id1' "; //execute query $queryexe = odbc_do($connectionstring, $Query); //query database while(odbc_fetch_row($queryexe)) { //collect results $BRET4002.Mat = odbc_result($queryexe, 1); $BRET4002.Localiz = odbc_result($queryexe, 2); $BRET4002.Qtd_Saldo = odbc_result($queryexe, 3); $PARAM006.Descr = odbc_result($queryexe, 4); $PARAM006.Refer = odbc_result($queryexe, 5); //format and display results print ("<tr>"); print ("<td>$BRET4002.Mat</td>"); print ("<td>$BRET4002.Localiz</td>"); print ("<td>$BRET4002.Qtd_Saldo</td>"); print ("<td>$PARAM006.Descr</td>"); print ("<td>$PARAM006.Refer</td>"); print ("</tr>"); } //disconnect from database odbc_close($connectionstring); ?></table></body> </html> Alguem sabe o que pode ser êsse erro?Está dando Parse error: parse error in c:\easyphp1-8\www\teste1.php on line 44ObrigadoÉ dessa linha para baixo
$BRET4002.Mat = odbc_result($queryexe, 1);
$BRET4002.Localiz = odbc_result($queryexe, 2);
$BRET4002.Qtd_Saldo = odbc_result($queryexe, 3);
$PARAM006.Descr = odbc_result($queryexe, 4);
$PARAM006.Refer = odbc_result($queryexe, 5);
//format and display results
print ("<tr>");
print ("<td>$BRET4002.Mat</td>");
print ("<td>$BRET4002.Localiz</td>");
print ("<td>$BRET4002.Qtd_Saldo</td>");
print ("<td>$PARAM006.Descr</td>");
print ("<td>$PARAM006.Refer</td>");
print ("</tr>");
}
//disconnect from database
odbc_close($connectionstring);
?>
Desculpe naum usar pelo
mas eh que deu pau nesse botao aqui no browser
Porque usar ODBC ? não é um banco em mysql ?[]'s
Nops, se fosse estaria feliz, hehehe.. mas como eh software de ERP e os caras naum conseguem jogar via web eu preciso gerar os relatorios para que a chefia possa ver da casa deles... Tentei fazer de outra forma, mas aih acho que piora mais ainda<head><title>Estoque</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript" type="text/JavaScript"><!--function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);//--></script></head> <body bgcolor="#FFFFFF"> <table width="28%" border="1" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF"> <tr bgcolor="#CCFFFF"> <td width="33%" height="22"><div align="center"><b>Material</b></div></td> <td width="36%" height="22"><div align="center"><b>Localização</b></div></td> <td width="31%" height="22"><div align="center"><b>Qtd Saldo </b></div></td> <td width="31%"><div align="center"><strong>Descr</strong></div></td> <td width="31%"><div align="center"><strong>Refer</strong></div></td> </tr> <?php //connect to the database $connectionstring = odbc_connect("Regency", "", ""); $id1 = $_POST["codfameq"]; //SQL query $Query = "SELECT BRET4002.Mat as Mat, BRET4002.Localiz as Localiz, BRET4002.Qtd_Saldo as Qtd_Saldo, PARAM006.Juncao as Juncao, PARAM006.Descr as Descr, PARAM006.Refer as Refer from (BRET4002 INNER JOIN PARAM006 ON Localiz = Juncao) WHERE Mat = '$id1' "; //execute query $queryexe = odbc_do($connectionstring, $Query); //query database while(odbc_fetch_row($queryexe)) { //collect results $Mat = odbc_result($queryexe, 1); $Localiz = odbc_result($queryexe, 2); $Qtd_Saldo = odbc_result($queryexe, 3); $Descr = odbc_result($queryexe, 4); $Refer = odbc_result($queryexe, 5); //format and display results print ("<tr>"); print ("<td>$Mat</td>"); print ("<td>$Localiz</td>"); print ("<td>$Qtd_Saldo</td>"); print ("<td>$Descr</td>"); print ("<td>$Refer</td>"); print ("</tr>"); } //disconnect from database odbc_close($connectionstring); ?></table></body> </html> Apareceu a seguinte msgWarning: odbc_do(): SQL error: [Flex/ODBC] Expected lexical element not found: <identifier>, SQL state 37000 in SQLExecDirect in c:\easyphp1-8\www\teste2.php on line 44Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in c:\easyphp1-8\www\teste2.php on line 47Soh que a linha 44 é " $queryexe = odbc_do($connectionstring, $Query);"Cara nunca vi isso, vou ficar devendo uma ajuda...
Sem problemas... estou tentando ver nos sites americanos se encontro algo a respeito
Mostra para gente a linha 44 por favor,