tags:

views:

21

answers:

2

I'm trying to display the data here in order of:

Author Name

Book Name

Url

NOTE: There are many results for each piece of data. Im not sure how they are stored in the array when they are fetched.

The database schema is relational as you will see and connects these bits of information from different areas of the database.

Im new to programming as you may have figured.

Im at a loss here.

Here is my code:

<?php

//Starting session

session_start();

//Includes mass includes containing all the files needed to execute the full script
//Also shows homepage elements without customs

include ('includes/mass.php');

//Set the  session variable

$username = $_SESSION['username'];


//Check to see if logged in

    if (isset($username))

        {

            //Check all databases assoc with the notes for username submissions

            $sql_for_username_submission = "SELECT notes.authname, notes.bookname, notes.url, notes.note_id, notes.user, smallnotes.chapter_name FROM notes INNER JOIN small_notes ON notes.note_id = small_notes.notes_id AND notes.user = small_notes.user ORDER BY notes.note_id";

            $get_data = mysql_query($sql_for_username_submission);

            while ($data_row = mysql_fetch_assoc($get_data))

                    {

                        $authnames = $data_row['authname']; 

                        Stopped here. not sure how to progress

                    }

        }   


?>
A: 

I would imagine you need some UI controls to which you would bind the data in data_row. In other words, you need to have some placeholders on the screen.

Best Regards

Big Endian
A: 

You are fetching my assosciative array so it does not matter. You can just reference the array item by key and use it whenever and where ever you want.

You do not have to worry about how the array is sorted.

Laykes
What if there are more than one value per row recieved by the array.
Tapha