Add/Delete/Edit button PHP/MYSQL
Add/Delete/Edit button PHP/MYSQL
Adasiax
Posts: 2Questions: 0Answers: 0
I've created a datatable with sorting function, but maybe someone can give me tutorial how can i add delete/edit/add buttons in my case?? because i got completely lost and confused on that page... http://code.google.com/p/jquery-datatables-editable/w/list
Here is my code :
[code]
<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("sample", $con);
$result = mysql_query("SELECT * FROM countries");
if (!$result) { // add this check.
die('Invalid query: ' . mysql_error());
}
?>
<!DOCTYPE html>
DataTables
@import "demo_table_jui.css";
@import "jquery-ui-1.8.4.custom.css";
*{
font-family: arial;
}
$(document).ready(function(){
$('#myDataTable').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
});
Name
Address
Postcode
Town
Country
Serbia
France
Italy
Add
Country
Population
Internet Users
Penetration (% Population)
World % Users
<?php
while ($row = mysql_fetch_array($result)) {
?>
<?=$row['name']?>
<?=$row['population']?>
<?=$row['internet_users']?>
<?=$row['penetration']?>
<?=$row['world_users']?>
<?php
}
?>
[/code]
Here is my code :
[code]
<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("sample", $con);
$result = mysql_query("SELECT * FROM countries");
if (!$result) { // add this check.
die('Invalid query: ' . mysql_error());
}
?>
<!DOCTYPE html>
DataTables
@import "demo_table_jui.css";
@import "jquery-ui-1.8.4.custom.css";
*{
font-family: arial;
}
$(document).ready(function(){
$('#myDataTable').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
});
Name
Address
Postcode
Town
Country
Serbia
France
Italy
Add
Country
Population
Internet Users
Penetration (% Population)
World % Users
<?php
while ($row = mysql_fetch_array($result)) {
?>
<?=$row['name']?>
<?=$row['population']?>
<?=$row['internet_users']?>
<?=$row['penetration']?>
<?=$row['world_users']?>
<?php
}
?>
[/code]
This discussion has been closed.
Replies
Can't say about the editable plug-in though - that's third party (and deprecated as far as I'm aware).
Allan