脚本宝典收集整理的这篇文章主要介绍了php – 使用指向另一个查询的链接运行查询.,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我正在使用的示例查询.
<?PHP $con = MysqL_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . MysqL_error()); } MysqL_select_db("bdcarterascv2",$con); $COD_PaiS = '3'; $F_HASTACORTE = '2012-03-31 01:00:00'; $result = MysqL_query("SELECT mcarteras.DES_CARTERA_CC AS 'Short Name of Fund',mcarterasflias.DES_CARTERAFLIA AS 'I/C',msociedades.DES_SOCIEDAD_CORTO AS 'Fund Manager Company',mcarteras_clases.DES_CARTERACLASE AS 'Class',mcarteras_clasesesp.DES_CARTERACLASE_ESP AS 'SPEcial Class',dr_rentmovil_carteras.POR_RENTCARTERA AS 'TTR year-to-date %',DFicha_mes.POR_REMUNERA_CObrADA AS 'Mgmt Fee Effectively Charged',dficha_mes.POR_GASTOS_totalESC AS 'Total Expenses %',dficha_mes.VR_CARTERA_fcORTE AS 'Fund Size' From mcarteras INNER JOIN mcarterasflias ON mcarterasflias.ID_CARTERAFLIA = mcarteras.ID_CARTERAFLIA INNER JOIN msociedades ON msociedades.ID_SOCIEDAD = mcarteras.ID_SOCIEDADADM INNER JOIN mcarteras_clases ON mcarteras_clases.ID_CARTERACLASE = mcarteras.ID_CARTERACLASE INNER JOIN mcarteras_clasesesp ON mcarteras_clasesesp.ID_CARTERACLASE_ESP = mcarteras.ID_CARTERACLASE_ESP INNER JOIN dr_rentmovil_carteras ON dr_rentmovil_carteras.ID_CARTERA = mcarteras.ID_CARTERA AND dr_rentmovil_carteras.COD_PAIS = $COD_PAIS AND dr_rentmovil_carteras.F_HASTACORTE = '$F_HASTACORTE' AND dr_rentmovil_carteras.ID_FORMATO = 1 AND dr_rentmovil_carteras. ID_COLUMNA = 5 INNER JOIN dficha_mes ON dficha_mes.ID_CARTERA = mcarteras.ID_CARTERA AND dficha_mes.COD_PAIS = $COD_PAIS AND dficha_mes.F_CORTE = '$F_HASTACORTE' WHERE mcarteras.COD_PAIS = $COD_PAIS AND mcarteras.ID_CARTERATIPO = 4 AND mcarteras.ID_CARTERAFLIA IN ( 3,4 ) AND mcarteras.IND_PubLICACION = 1 AND mcarteras.COD_ESTADO= 1 ") or die(MysqL_error()); // HTML ... Aliases from MysqL echo "<table border='1'> <tr> <th>Short Name of Fund</th> <th>I/C</th> <th>Fund Manager Company</th> <th>Class</th> <th>Special Class</th> <th>TTR year-to-date %</th> <th>mgmt Fee Effectively Charged</th> <th>Total Expenses %</th> <th>Fund Size</th> </tr>"; //<tr> specifies table row. for each <td> (table data) will specify a new column. The $row specifies the MysqL column name (in this case using an alias) while($row = MysqL_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Short Name of Fund'] . "</td>"; echo "<td>" . $row['I/C'] . "</td>"; echo "<td>" . $row['Fund Manager Company'] . "</td>"; echo "<td>" . $row['Class'] . "</td>"; echo "<td>" . $row['Special Class'] . "</td>"; echo "<td>" . $row['TTR year-to-date %'] . "</td>"; echo "<td>" . $row['Mgmt Fee Effectively Charged'] . "</td>"; echo "<td>" . $row['Total Expenses %'] . "</td>"; echo "<td>" . $row['Fund Size'] . "</td>"; echo "</tr>"; } echo "</table>"; MysqL_close($con); ?>
以上是脚本宝典为你收集整理的php – 使用指向另一个查询的链接运行查询.全部内容,希望文章能够帮你解决php – 使用指向另一个查询的链接运行查询.所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。