Members: 16,996
Threads: 38,868
Posts: 159,480
Online: 54

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 23.03.2007, 08:13   #1 (permalink)
Baby Mamber
 
Join Date: Nov 2006
Posts: 6
bummibaum is on a distinguished road
Default php code

good mornig,

soory my english is not so good.
I will insert phpcode with mosphp.
Iwill read all name from jos_users.
can erverybody say what i do wrong:

<?php
function test() {
global $database;
$database->setQuery("SELECT Name FROM jos_useres");
$rows = $database->loadObjectList();
foreach( $rows as $row ) {
echo "$row->Name<br />\n";
}
}
test();
?>

The message is:
Invalid argument supplied for foreach() in D:\Programme\Xampp\xampp\htdocs\joomla\myPhp\db3.p hp on line 6


Thanks i hope erverybody can help me
bummibaum is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 23.03.2007, 13:33   #2 (permalink)
Baby Mamber
 
Join Date: Mar 2007
Posts: 1
lali_shlomov is on a distinguished road
Default Re: php code

I think you need to put "" on line 6 (foreach command)...
__________________
micheal,
Best Games Land
lali_shlomov is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 23.03.2007, 14:00   #3 (permalink)
Baby Mamber
 
Join Date: Nov 2006
Posts: 6
bummibaum is on a distinguished road
Default AW: php code

thanks i will tested.
bummibaum is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 24.03.2007, 13:20   #4 (permalink)
Baby Mamber
 
Join Date: Nov 2006
Posts: 6
bummibaum is on a distinguished road
Default AW: php code

mhh, the problem with foreach is detached.
But the next problem is the folling message:

Catchable fatal error: Object of class stdClass could not be converted to string in D:\Programme\Xampp\xampp\htdocs\joomla\myPhp\db3.p hp on line 7


My SourceCode:
I hope everybody can help me
Thaks
<?php
function userdatenauslesen() {
global $database;
$database->setQuery("SELECT * FROM jos_users");
$rows = $database->loadObjectList();
foreach ($rows as $row => $value) {
echo $value . '<br />';

}
}
userdatenauslesen();
?>
bummibaum is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Component/Module/Bot code checker initiative active6 Mambo 4.5 Security 5 06.02.2005 05:53
Highlight PHP Code GianniT Mambo 4.5.1 General Talk 2 09.11.2004 13:56
Include PHP (and/or ASP) code in content cstalenberg Mambo 4.5 General Talk 5 15.10.2004 01:33
php code to tell me what main menu i am in?? mattymattmatt Mambo 4.5 'How Do I' Questions 3 22.09.2004 13:26
PHP Code to catch SubMenus only in Template Gunnar Template Discussions 3 10.06.2004 12:30


All times are GMT +2. The time now is 19:27.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.