SalientAnimal Posted June 7, 2010 Share Posted June 7, 2010 Hi guys, My question here is pretty simple. I am struggling to get a PHP page to Query my MySQL data base and to display this on the page in a table. In addition to this, I would like to be able to edit the data in my table from the returned results. i.e Next to each result row ther should be an edit link, when clicking the link it opens the data and allows you to edit it and then submitting it to the data base to edit the entry. Another Question I have is how to capture an image, i.e scanned in document to a MySQL database. I would like to create a form that captures a name, surname, email address, and finally the image or any other file format. I have started working on the code form my second question, but do not have now to include on this post. Will update that ASAP. Thanks Guys Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted June 7, 2010 Share Posted June 7, 2010 pseudo-code . . . Display records while( $array = mysql_fetch_assoc( $result ) { echo $array['field1'] $array['field2'] $array['field3] . "<a href=\"edit_page.php?id=" . $array['primary_key_field'] . "\">Edit Record</a><br>"; } Then use a form to process the data. Query the db for the record requested in the $_GET var, and display the results in form fields appropriate for the data type (probably text for most of them). You can use the same script to run the UPDATE query simply by checking to see if it has been submitted to itself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.