Jump to content

Help: A newbie problem here with the undefined index:


enhu

Recommended Posts

Notice: Undefined index: positon in C:\wamp\www\enhu\content.php on line 15

About Enhu

 

 

  $result = mysql_query("SELECT * FROM subjects", $connection);

                            if (!$result) {

                                die("Database query failed: " . mysql_error());

                            }

                 

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

                            echo $row["menu_name"]." ".$row["positon"]."<br />";

                        }

 

 

 

The line 15th line  the while statement:

 

 

you were right.  i take the ".$row["positon"] away

and leave the while statement to this

 

hile ($row = mysql_fetch_array($result)) {

                            echo $row["menu_name"]."<br />";

                        }

 

and it works. thank you. you didnt seem to drop my faith at all.

Go to your database with PhpMyAdmin or w/e you use and find out what fields you have in the 'subject' table.  When you SELECT * it means you select everything and if you only need that one row then only select menu_name.  So obviously the position field does not exist.

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.