Welcome Guest, Not a member yet? Register   Sign In
Flexigrid - delete.php is not working - help needed!!!
#1

[eluser]jikowhitewolf[/eluser]
I have been trying to get delete.php to work from http://sanderkorvemaker.nl/test/flexigrid/ again , but somehow it is not deleting from my table, even when i have enabled the sql runSQL to do the delete action.

I read someone has the same problem at this post. http://ellislab.com/forums/viewthread/75326/P270/
post#280, that all they did is remove the trailing comma (,) but where is the trailing comma (,)?

Code:
<?
error_reporting(0);
function runSQL($rsql) {
    $hostname = "localhost";
    $username = "root";
    $password = "";
    $dbname   = "tutorial";
    $connect = mysql_connect($hostname,$username,$password) or die ("Error: could not connect to database");
    $db = mysql_select_db($dbname);
    $result = mysql_query($rsql) or die ('test');
    return $result;
    mysql_close($connect);
}

$items = rtrim($_POST['items'],",");
$sql = "DELETE FROM 'service_table' WHERE 'id' IN ($items)";

$total = count(explode(",",$items));
$result = runSQL($sql);
$total = mysql_affected_rows();
/// Line 18/19 commented for demo purposes. The MySQL query is not executed in this case. When line 18 and 19 are uncommented, the MySQL query will be executed.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header("Cache-Control: no-cache, must-revalidate" );
header("Pragma: no-cache" );
header("Content-type: text/x-json");
$json = "";
$json .= "{\n";
$json .= "query: '".$sql."',\n";
$json .= "total: $total,\n";
$json .= "}\n";
echo $json;
?>


Messages In This Thread
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-04-2010, 05:19 PM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-04-2010, 06:25 PM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-04-2010, 08:36 PM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-05-2010, 01:05 AM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-05-2010, 05:20 AM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-10-2010, 07:09 AM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-11-2010, 01:16 AM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-12-2010, 07:37 AM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-12-2010, 09:45 AM
Flexigrid - delete.php is not working - help needed!!! - by El Forum - 02-12-2010, 09:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB