Re: Display records on form
| From: | Jochem Maas | Date: | Tue, 04 Jan 2005 12:17:19 +0000 |
| Subject: | Re: Display records on form | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37970@lists.php.net to get a copy of this message | ||
David Ziggy Lubowa wrote:
On Tuesday 04 January 2005 10:10, David Ziggy Lubowa wrote:how does somebody manage to create a working script to insert/update data in a table and not be able to figure out how to output a simple HTML table listing the current records????? I mean, do you want us to teach you how to write PHP? (My rate is 40euros/hour) -- Sorry David but your email shows little to no effort on your part to: a, define you problem succinctly b, show context (e.g. code,SQL snippets) c, show that you have made a decent effort to work the problem. given those facts you can consider yourself lucky to recieve any replies at all. ANYWAY... seeing as I'm bitchin' at ya I might as well give you a small clue.... the process, roughly speaking is: 1. do a SQL select query. (e.g. SELECT id,name FROM mytable) 2. loop thru the result, for each row output some HTML for a table row e.g. echo ' <tr> <td><a href="/edit.php?id='.$row['id'].'">edit</td> <td>'.$row['id'].'</td> <td>'.$row['name'].'</td> </tr>' 3. don't forget to add begin- and ending TABLE tags. try googling 'display a MYSQL result set with PHP': I came up with: http://juicystudio.com/tutorial/php/mysql.asp (which is pretty funny cos the guy wrote a tutorial on mysql/php on an ASP based site!!)Hey guys , I was wondering , i have 16 records within a table in my Database , i have managed to have a form which can add and modify the records. My only problem is how i can display on a form when i search. Can someone give me heads up on how i can code this in php, to display the records in a tabular manner when i search.
sorry i meant 16 fields not records : )whether you tables has 16 rows or fields seems to me to be completely irrelevant.
Any help is highly appreciated. cheers -Z