Connecting Form to phpmyadmin using mysqli

Hello there!
This forum rocks!
How does the dhtmlxform connect and post my phpmyadmin?! I can’t get it to connect. :frowning:

This is the code for my Form File…

formfile.php

testFowurhm

When I click SUBMIT, nothing posts to my phpmyadmin.

Here’s the connecting file…

<?php require("./codebase/form_connector.php"); //includes related connector file require("./codebase/db_mysqli.php"); $res= new mysqli('localhost','root','username', 'password') or die("I Cant Connect and get the following error" . mysqli_error($res)); //connects to server containing the desired DB $conn = new formConnector($res,"MySQLi"); //connector initialization //$conn->render_table('tableName','','column1,column2,etc'); //data configuration ?>

HELP PLEASE :slight_smile:
Thanks!
This is extremely helpful :slight_smile:
-Eric-

Hello!
I got my form to connect to my localhost phpmyadmin :slight_smile:
I do have a follow-up question as I continue to figure this thing out.

The DATA that uploads from the form to my phpmyadmin database is EMPTY.
Why?
How Do I assure that the info form each dropdown in the form gets transferred to the database?
Data-Type name-resolution problem, perhaps?
Perhaps index.html isn’t collecting the info correctly?

Thanks so much!

Here’s the error that shows up in the debugger…

Fatal error: Uncaught exception ‘Exception’ with message ‘ID parameter is missed’ in /Users/etc…/Sites/timeTrack/codebase/form_connector.php:57 Stack trace: #0 /Users/etc…/Sites/timeTrack/codebase/base_connector.php(467): FormConnector->parse_request() #1 /Users/etc…/Sites/timeTrack/codebase/base_connector.php(398): Connector->render() #2 /Users/etc…/Sites/timeTrack/formdata.php(8): Connector->render_table(‘infoInput’, ‘’, ‘tickNumber,tech…’) #3 {main} thrown in /Users/etc…/Sites/timeTrack/codebase/form_connector.php on line 57

Again, I got the form to send EMPTY entries into my phpmyadmin table.
I can’t figure out why DATA doesn’t go into the site :frowning:

testFowurhm

Here.s formdata.php…

<?php require_once("./codebase/form_connector.php"); //includes related connector file require("./codebase/db_mysqli.php"); $res= new mysqli("localhost","root","","infiSticker") or die("I Cant Connect and get the following error" . mysqli_error($res)); //connects to server containing the desired DB $conn = new formConnector($res,"MySQLi"); //connector initialization $conn->render_table("infoInput","","tickNumber,techName,clientName,timeWorked"); //data configuration ?>

Thanks!!

Hi,

Please try to use dev. tools and check which data is sent to server side when you are clicking on “save” button.

Normally it must be a POST request, that contains many parameters including the “ids”, which will contain the id of the saved form. Error log shows that something was wrong with parameters, but js code that you are using, looks fine.

Are you using latest dhtmlx.js or some older version ?

Hello!
I am using the latest dhtmlx.js as far as I know :slight_smile:
I have seen the POST in my Safari debugging console, with the ID’s of the rows in the Drop-down menus that I’ve selected.
Yet, no actual numbers or data, not even the ID numbers, who up in the database. Just empty rows :frowning:

Thanks

Please try to do the next

  • remove connector.js and dataprocessor.js scripts from the page
  • in onButtonClick handler replace ==‘Save’ with ==‘submit’

After such modifications, your sample works correctly for me