Solved

How  can I populate this form with data from the my database?

Posted on 2011-03-18
2
182 Views
Last Modified: 2012-05-11
Hi,

I'm unable to get data from my database.

I left the connection variables blank (for secutiry reasons)

Can anyone get this to work?
Status-project.php
config.sql
0
Comment
Question by:Computer Guy
2 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35164803
Well, you need to post a file with the <form>.
There is no form, thus there is no $_POST variables. If there are no post variables then the fields are empty.
0
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 500 total points
ID: 35164810
I can't fix the code for you but here is what I would do to debug:

 
$query = "select * from $table";
$result = mysql_query($query) or die ("error");
$num = mysql_num_rows($result);

// See how many rows you are getting back
echo 'Num rows: '.$num.'<br />';

if($num > 0){
    $row = mysql_fetch_array($result) or die("error");

    // dump values of the rows
    print_r($row);

}

Open in new window


that should tell you if you are getting data back and what it looks like.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question