Hi all,
Ive been trying to get some data from my db into a form im building, however when ever I try and do so I get the following error
“Notice: Undefined index: ids in C:\wamp\www\codebase\connector\form_connector.php on line 51”
I’ve followed the tutorial as close as I can but I keep getting the same error is it something to do with the fact that my pk field is not called id and is not auto update?
here is my form code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="STYLESHEET" type="text/css" href="css/layout.css">
<link rel="STYLESHEET" type="text/css" href="css/dhtmlx/dhtmlxform_dhx_skyblue.css">
<script type ="text/javascript" src="js/dhtmlx/dhtmlxcommon.js"></script>
<script type ="text/javascript" src="js/dhtmlx/dhtmlxform.js"></script>
<script type ="text/javascript" src="js/dhtmlx/dhtmlx.js"></script>
<script type ="text/javascript" src="js/dhtmlx/dhtmlxdataprocessor.js"></script>
<script type ="text/javascript" src="js/dhtmlx/connector.js"></script>
<script type ="text/javascript" src="js/dhtmlx/dhtmlxform.js"></script>
<script type="text/javascript" src="js/dhtmlx/datastore.js"></script>
<script type="text/javascript"> function onLoad(){
formData = [
{type: "input", name:"SNo", label: "ID"},
{type: "input", name:"Surname", label: "Surname"},
{type: "input", name:"Forename", label: "Forename"},
{type: "input", name:"Other_Email", label: "Other Email"},
{type: "input", name:"Personal_Email", label: "Personal Email"},
{type: "input", name:"Home_Phone_No", label: "Home Phone No"},
{type: "input", name:"Work_Phone_No", label: "Work Phone No"},
{type: "input", name:"Mobile_Phone_No", label: "Mobile Phone No"},
{type: "input", name:"Address_Line_1", label: "Address Line 1"},
{type: "input", name:"Address_Line_2", label: "Address Line 2"},
{type: "input", name:"Address_Line_3", label: "Address Line 3"},
{type: "input", name:"Address_Line_4", label: "Address Line 4"},
{type: "input", name:"Post_Code", label: "Post_Code"},
{type: "input", name:"M_ID", label: "Mode ID"},
{type: "input", name:"R_ID", label: "Route ID"},
];
myForm = new dhtmlXForm("formContainer", formData);
myForm.load('resources/lib/cons/sdetails_formconnection.php?Student_No=1');
mydp = new dataProcessor ("resources/lib/cons/sdetails_formconnection.php?S_No=1");
mydp.init(myForm);[/code]
And this is my connector code:
[code]<?php
define('CONFIG_PATH', $_SERVER['DOCUMENT_ROOT'] . '/resources');
require_once (CONFIG_PATH . '/config.php');
require_once (CODEBASE_PATH . '/connector/form_connector.php');
$host = $dbConfig ['dbSettings']['mysql']['host'];
$dbName = $dbConfig ['dbSettings']['mysql']['dbname'];
$userName = $dbConfig ['dbSettings']['mysql']['username'];
$pwd = $dbConfig ['dbSettings']['mysql']['password'];
// get the db settings for each paramter an store each in a variable
$conn = mysql_connect($host, $userName, $pwd);
mysql_select_db($dbName);
// create a new connection to the db using variables from config file
$form_conn = new FormConnector($conn, "MySQL");
// intilize the connector
$form_conn->render_table("user", "", "S_No,Surname,Forename,Other_Email,
Personal_Email,Home_Phone_No,Work_Phone_No,Mobile_Phone_No,Address_Line_1,
Address_Line_2,Address_Line_3,Address_Line_4,Post_Code,Mode_ID,Route_ID");
// render the form
?>
Does anyone know where im going wrong? probably something simple im a real noob to this .