Jump to content

[SOLVED] query returns only first letter.


next

Recommended Posts

I have a really strange problem, here's my code:

<?php
include('config/config.php');
include('lib/database.class.php');


//Database::connect();
try {
	$result = Database::query("CALL index_page_forum_info('general')", PDO::FETCH_ASSOC);
	echo print_r($result);

	foreach($result as $key => $row)
		echo '<br />' . $row['forum_title'];
}
catch(PDOException $e) {
	trigger_error($e->getMessage(), E_USER_ERROR);
} ?>

 

here's my output:

Array ( [forum_id] => 1 [forum_title] => Upcoming Movies [forum_descr] => Discuss upcoming movies and film not yet in theatres here. [num_threads] => 1 [num_comments] => 0 ) 1

1

U

D

1

0

I don't get it, how come my array contains all the necessary data, but outputs only first letter through "foreach" loop? Can anybody help?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/117049-solved-query-returns-only-first-letter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.