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.
Not a member yet? Click here to register.
Forgot Password?

dbquery does not show

Asked Modified Viewed 1,345 times
H
helmuth
H
Danish translator of PHP-Fusion helmuth@php-fusion.dk
-----------------------------------------
All people are born alike - except Republicans and Democrats. (Groucho Marx)
Listen to the music... https://soundcloud.com/helmuth-mikkel...mikkelsen/
  • Senior Member, joined since
  • Contributed 706 posts on the community forums.
  • Started 219 threads in the forums
  • Started this discussions
  • Answered 1 question
asked
Senior Member

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?
0 replies

1 post

F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

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 N/A on 04-11-2018 14:09,
0 replies

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
H
H
Danish translator of PHP-Fusion helmuth@php-fusion.dk
-----------------------------------------
All people are born alike - except Republicans and Democrats. (Groucho Marx)
Listen to the music... https://soundcloud.com/helmuth-mikkel...mikkelsen/
  • Senior Member, joined since
  • Contributed 706 posts on the community forums.
  • Started 219 threads in the forums
  • Started this discussions
  • Answered 1 question

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet