Hallo
ich hab eine php datei artists.php, welche ich über ein form feld in einem artikel bediene.
Eingabe ist ein Künstlername und Rückgabe ist eine Liste mit gefundenen Veröffentlichungen.
Das ganze sieht so aus.
wenn ich jetzt das script MIT diesem joomla zugriff probiere kriege ich ein 500 HTTP Status code. Benutze ich die mysql connect klasse und gebe explizit benutzername usw an, funktioniert es. Es hängt also wie gesagt an dem Joomla DB Teil.Code:$user = JFactory::getUser(); echo $user->get('id'); $q=mysql_real_escape_string($_GET["q"]); $sql="Select * from jos_artistsearch where Artist like '%$q%' OR Album like '%$q%' OR Title like '%$q%'"; $db->setQuery($sql); if ( $db->query() ) { $rows = $db->loadObjectList(); echo "<table id='rounded-corner' style='margin-left:5px;margin-top:10px;'border='0'> <thead> <tr> <th scope='col' class='rounded-company'>ID</th> <th scope='col' class='rounded-q1'>Künstlername</th> <th scope='col' class='rounded-q2'>Album</th> <th scope='col' class='rounded-q3'>Titel</th> <th scope='col' class='rounded-q4'>Releasedatum</th> <th scope='col' class='rounded-q5'>Beschreibung</th> </tr></thead><tfoot> <tr> <td colspan='5' class='rounded-foot-left'><em>Leico-music Artist Library Copyright @2011</em></td> <td class='rounded-foot-right'> </td> </tr> </tfoot><tbody>"; forach($rows as $row) { echo "<tr>"; echo "<td>" . $row->id . "</td>"; echo "<td>" . $row->Artist . "</td>"; echo "<td>" . $row->Album . "</td>"; echo "<td>" . $row->Title . "</td>"; echo "<td>" . $row->ReleaseDate . "</td>"; echo "<td>" . $row->Description . "</td>"; echo "</tr>"; } echo "</tbody></table>"; } ?>
PHP Datei liegt im Unterverzeichnis /artist im joomla ROOT.


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen