Jump to content

datagrid in html

Recommended Posts

I'm doing a project using html, php and mysql. I want to make something like a form in vb but i want to use html. i used form tag but inside this form i need to show a list of records , I can use a table to show them but the problem is that I need the user to click on a certain record and be able to change it , or delete it, also i need when I add another record it is added below in the list. In vb we can use a datagrid Is there anything in html similar to this, or if u have any other ideas for how to do theseplease help me. knowing that the only problem is that the tool, whereas the queries and everything is simple to me.

Link to post
Share on other sites

use something like this:

<?phpif(isset($delete)){//delete stuff}if(isset($save)){//save stuff}?><form><table><?phpfor($i=0;i<mysql_numrows($result);i++){?><tr><td><input type="text" name="record01" value="<?=$myRecordValue[1]?>"></td><td><input type="text" name="record02" value="<?=$myRecordValue[2]?>"></td><td><input type="submit" name="save" value="save"><input type="submit" name="delete" value="delete"><input type="hidden" name="rownumber" value="<?=$i?>"></td></tr><?php}?></table></form>

that was pretty thrown together, but I hope it answered some questions...

Link to post
Share on other sites

hi I did something like that but know i'm facing a problem.under if(isset($delete)){//delete stuff}if I want to delete this stuff I should take the value of record01 and record02how can I do this in php and put them in variables such as $r1,$r2 to delete or update, knowing that I need to stay on the same page.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...