LastMitch
Industrious Poster
4,191 posts since Mar 2012
Reputation Points: 134
Solved Threads: 336
Skill Endorsements: 45
LastMitch
Industrious Poster
4,191 posts since Mar 2012
Reputation Points: 134
Solved Threads: 336
Skill Endorsements: 45
Are you using a CMS for this?
The code that you wrote is not going to work.
I don't think this will work.
while($mlist=mysql_fetch_array($query_list)){
Plus do you have a table?
The code is more than that. You need to used the $_GET function to get the id.
$query_list = mysql_query("SELECT column_name(s) FROM table_name WHERE column_name= operator value");
$row = mysql_fetch_array($query_list);
$id = $row['id'];
$name = $row['name'];
$company = $row['company'];
$email = $row['email'];
$NP = $row['NP'];
$EC = $row['EC'];
UPDATE table_name SET column1=value, column2=value2 WHERE some_column=some_value
echo "<table>";
echo "<tr><td>$name</td><td>$company</td><td>$email</td><td>$NP</td><td>$EC</td></tr>"
echo "</table>";
This is just a guideline. So you can start learn it. This is all I can help you for now.Try to modify it to your code. If you show some efforts and results then maybe I'll assist you more. For you are on your own.
LastMitch
Industrious Poster
4,191 posts since Mar 2012
Reputation Points: 134
Solved Threads: 336
Skill Endorsements: 45
How do I echo out new field that is added to the database with out having to re-write the code. I have my standard fields. id, name, company, email. Any other ones ie with my above code are EC NP. If I didn't echo them out manaully how would I do it with my code so that if I have 2 or 50 new fields it will echo out automatically. I don't want to update my php file everytime a new field is added.
OK, EC & NP did you create spot for those EC & NP in your table?
You need a form you do submit it, so it will automatically update in the database.
Once the form is submited then it will appear on the next page.
You are not doing this manually.
LastMitch
Industrious Poster
4,191 posts since Mar 2012
Reputation Points: 134
Solved Threads: 336
Skill Endorsements: 45
Those I will have coded in manually into my page. BUT if I add a new field into that table.. how do i get that to automatically show on my page with out having to manually add php code for it. I know there is some type of foreach or loop or something that will do this. I just don't know how to search for it correctly.
So if I make a new field called company1 it will show beside my other fields that I have.. I don't want to code my page every time I add a new company in. I'd like to have something that will automatically show it on the page rather then going in and adding it manually on the page. I don't want to go in and do a echo new companyname in each time.
Then Try This:
http://pear.php.net/manual/en/package.database.mdb.intro-fetch.php
I really don't know what else to tell you. I spend too much time explaining and write code.
You need to download that package in order for it to work.
LastMitch
Industrious Poster
4,191 posts since Mar 2012
Reputation Points: 134
Solved Threads: 336
Skill Endorsements: 45