output array from database to twig (simple job)

I have the following in my PHP file:

$sql = "SELECT id, email FROM users";

$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {

// output data of each row

while($row = mysqli_fetch_assoc($result)) {

$twig->addGlobal('users', $sql);

$twig->addGlobal('id', $row["id"]);

$twig->addGlobal('email', $row["email"]);

//echo "id: " . $row["id"]. " - Name: " . $row["email"]. " ";


} else {

echo "0 results";


and my twig file is

{% for id in users %}


<td>{{ id }}</td>

<td>{{ email }}</td>


{% endfor %}

The echo output works as expected however I can't seem to get the table to work

[login to view URL]

This is a quick job I will only pay AUD$10

Fähigkeiten: PHP, MySQL, SQL

Mehr darüber database management design job, simple job application, can form output access database, simple job applications, simple job scheduler, job status table sql 2000, html form output access database, need simple job, simple vbscript display table data sql server, resume database administrator sql job jobs, simple job application form html, freelance simple job, output pdf database, javascript array database, part time - simple clicking job - $10 per day *****, part time - simple clicking job - $10 per day, part time simple clicking job 10 per day, ***** PART TIME - Simple clicking job - $10 per day *****

Über den Arbeitgeber:
( 3 Bewertungen ) DERBY, Australia

Projekt-ID: #21066943

9 Freelancer bieten im Durchschnitt $14 für diesen Job


Hello hiring member i am bhavika i have 3+years experience in php ,laravel , ajax , jquery , javascript ,html ,css , bootstrap i can solve this table fetching problem i have done many project so i can do it and i can Mehr

$10 AUD in 1 Tag
(154 Bewertungen)

Hello. I read your project fully and I can do it in a few hours. As you can see my profile, I have rich experiences in web. If you hire me, I will do my best and you will see successfully result. Please contact me. Ki Mehr

$20 AUD in 1 Tag
(45 Bewertungen)

Dear Client! I am very happy to see your project detail. I think it is just my project. :) As you can see in my profile, (my review: I have much experience with your job. I t Mehr

$20 AUD in 7 Tagen
(21 Bewertungen)

you are doing [login to view URL] is with variable not the php.i am expert in twiging. I have more than 6 + years experience.

$20 AUD in 1 Tag
(41 Bewertungen)

Hi What is up ? I will fix it in a jiffy. No problem. Can i have your project detail ? Looking forward to your reply. Regards

$10 AUD in 1 Tag
(17 Bewertungen)

@ Dear Client. (24/7) I am very interested in your project. I have 7+ years experience in web & mobile development. I am well versed with HTML,CSS,JavaScript,Angular,PHP, Wordpress, Laravel, Mogodb,MySQL,Firebase..etc, Mehr

$10 AUD in 7 Tagen
(5 Bewertungen)

Hi, I can help you to fix your PHP script in an hour. Let's have chat to discuss further on this project. Thanks, Sayan

$10 AUD in 1 Tag
(14 Bewertungen)

Dear Employer Thanks for submitting project. Very Short Introduction We are Professional Private Limited Company having international joint ventures and managing offshore companies in UK,USA Mehr

$20 AUD in 7 Tagen
(1 Bewertung)

Hello sir/madam , We have good experience of PHP,HTML,HTML5,CSS, Ajax,jquesry,JavaScript,Mysql, Graphic Design,Website Design, wordpress, open cart , E-commerce etc. Out recent work [login to view URL] Mehr

$10 AUD in 7 Tagen
(8 Bewertungen)