jQWidgets Forums
Forum Replies Created
-
Author
-
June 24, 2015 at 4:59 am in reply to: Server Filtering + Editing – jqxGrid Server Filtering + Editing – jqxGrid #72916
Hi Peter,
I tried the exact example on northwind db, everything goes well except data won’t save to mysql db. on refresh, everything no change. Please update example
May 22, 2015 at 1:19 am in reply to: After update demo field name to mysql own field name, cannot load data After update demo field name to mysql own field name, cannot load data #71430Hi Ivailo,
Thx for the prompt reply.
The database table only has 5 column, I have modified the northwind db by removing other columns and just updating 2 field names. The rest of the code are same as php demo for server_side_grid_editing_with_popup except with the 2 updated field names for the whole file
EmployeeID
LastName
Email
Mobile
TitleOfCourtesyMay 21, 2015 at 7:02 am in reply to: After update demo field name to mysql own field name, cannot load data After update demo field name to mysql own field name, cannot load data #71386Instructor is mysql db, similar to Northwind except, I have changed the field name Title to mobile, Last name to Email
<?php
#Include the connect.php file
include(‘connect.php’);
#Connect to the database
//connection String
$connect = mysql_connect($hostname, $username, $password)
or die(‘Could not connect: ‘ . mysql_error());
//Select The database
$bool = mysql_select_db($database, $connect);
if ($bool === False){
print “can’t find $database”;
}
// get data and store in a json array
$query = “SELECT * FROM instructor”;if (isset($_POST[‘update’]))
{
// UPDATE COMMAND
$update_query = “UPDATE ‘instructor’ SETFirstName
='”.mysql_real_escape_string($_POST[‘FirstName’]).”‘,
Email
='”.mysql_real_escape_string($_POST[‘Email’]).”‘,
Mobile
='”.mysql_real_escape_string($_POST[‘Mobile’]).”‘ WHEREEmployeeID
='”.mysql_real_escape_string($_POST[‘EmployeeID’]).”‘”;
$result = mysql_query($update_query) or die(“SQL Error 1: ” . mysql_error());
echo “in update”;
console.log(“in update”);
echo $result;
}
else
{
// SELECT COMMAND
$result = mysql_query($query) or die(“SQL Error 1: ” . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$employees[] = array(
‘EmployeeID’ => $row[‘EmployeeID’],
‘FirstName’ => $row[‘FirstName’],
‘Email’ => $row[‘Email’],
‘Mobile’ => $row[‘Mobile’]
);
}echo json_encode($employees);
}
?> -
AuthorPosts