Solved

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

Posted on 2011-03-18
2
179 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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
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 …

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now