Solved

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

Posted on 2011-03-18
2
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Session time out quickly. 6 56
MySQL-Design Help 12 69
Failed to open stream: Permission denied in /var/www/html/export.php on line 24 5 79
PHP and accessing Array Elements 3 34
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

710 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