Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

dbquery does not show

helmuth - Latest reply on 04-11-2018 12:05 by Falk

0

helmuth
helmuth
I have this code that I want to produce a list of all items:

<?php
$result = dbquery(
 "SELECT 'dagensord_id', 'dagensord_text', 'dagensord_author' FROM 'fusion184Ny_dagensord'"
 );

echo "<div class='list-group-item'>ID: <strong> ".$data['dagensord_id']."</strong><br/></div> ";
echo "<div class='list-group-item'>TEXT: <strong> ".$data['dagensord_text']."</strong><br/></div> ";
echo "<div class='list-group-item'>AUTHOR: <strong> ".$data['dagensord_author']."</strong><br/></div> ";
echo "<div class='list-group-item'><br/></div> ";
?>


but it only shows this:

Quote

Alle citater
ID:
TEXT:
AUTHOR:


What am I doing wrong?

Sort replies by

0

Falk
Falk
Query are not in data array.
$result = dbquery(
 "SELECT 'dagensord_id', 'dagensord_text', 'dagensord_author' FROM 'fusion184Ny_dagensord'"
 );

to
$data = dbarray(dbquery(
 "SELECT 'dagensord_id', 'dagensord_text', 'dagensord_author' FROM 'fusion184Ny_dagensord'"
 ));


Edit
oh, I read list now.. so if more than 1 item.. you need a while sentence.

while $data = dbarray($result) {

// stuff

}
Edited by Falk on 04-11-2018 12:09, 1 month ago
Actions
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Forum Tags
More topics like this
Participated Users
Users who participated in discussion: :
helmuth, Falk

Moderators:
{%user_avatar%}

dbquery does not show
by {%user_profile_link%} {%post_date%}