ColumnOne ColumnTwo ColumnThree Columnfour Columnfive ColumnSix
one two three four 0 'Button Here'
正如您在上面看到的,我有六列,其中五列包含某种文本,第六列包含一个按钮。我的最终目标是让第六列包含三个按钮,就像下图一样HERE http://www.the-di-lab.com/crudgen-demo/manual/assets/images/1.png显示。这些按钮将允许我编辑、删除,可能还有其他功能。
不过,现在我只是好奇如何使用下面的代码使按钮出现在最后一列中:
<?php
// Create variables to retrieve the POST data
$ID= $_POST['Input1'];
$Email= $_POST['Input2'];
$Name= $_POST['Input3'];
$Company= $_POST['Input4'];
$Price= $_POST['Input5'];
// Connect to the database
mysql_connect ("localhost","Username","Password") or die ('Error: ' . mysql_error());
echo "connected to database!";
mysql_select_db ("Database");
// Insert data into table
$query = "INSERT INTO CustomerInformation (ID, Email,Name,Company,Price,Tab Count,Action) VALUES(
'NULL', '".$ID."', '".$Email."', '".$Name."', '".$Company."', '".$Price."', "Form input type = "button" (something like this!) )";
// Above is my best attempt... I'm sure it's nowhere close (sorry!).
mysql_query($query) or die ('Error updating database');
echo "Database updated successfully!";
?>