Jump to content

datagrid in html


mona
 Share

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 comment
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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...