Jump to content

[SOLVED] Cannot use object of type stdClass as array


cleary1981

Recommended Posts

what is wrong with this code?

 

the error i am getting is

<br />

<b>Fatal error</b>:  Cannot use object of type stdClass as array in <b>C:\wamp\www\listModules.php</b> on line <b>8</b><br />

 

heres my php

<?php

require "config.php"; // database connection details 

$sql="select module_name, mod_desc from module where confirmed='0'";
$result = mysql_query($sql) or trigger_error(mysql_error());
$row = mysql_fetch_object($result);
$return = $row['module_name']."%". $row['mod_desc'];
echo $return;
?>

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.