Forums

DB Connection

benny 07 Oct, 2008
Hey,

This my first time trying to use the database entry of chronoforms
ok i have created tables and done the database connection in the admin part.

when i try to submit the form i get this error
Fatal error: Call to a member function bind() on a non-object in C:\xampp\htdocs\joomla\components\com_chronocontact\chronocontact.php(569) : eval()'d code on line 10
Any1 help me out, i have searched here and came tried a few things that have been said but no luck.
GreyHead 07 Oct, 2008
Hi Benny,

Most often this is caused by invalid field names. Please check that your field names:
[list]
  • Use only a-z, A-Z, 0-9 and '_'
  • Have no spaces, '- / ? : , ( ) ' or other special characters
  • Start with a letter and not a number
  • Have quotes around them like name="field_name"
  • [/list]

    Bob
    benny 07 Oct, 2008
    Thanks for the reply Bob

    Are we talking about the field names in the autogenerated code tab? or the field name on the form itself, i tried making several new forms and same error comes up.

    cause it saying something about line 10 in the chronocontact.php file do i need to look at this file?
    benny 07 Oct, 2008
    Here is my chronocontact.php file

    or is it the chronocontact.html.php?

    [[>> file deleted : GreyHead <<]]
    GreyHead 07 Oct, 2008
    Hi Benny,

    Line 569 is
    eval( "?>".$rows[0]->autogenerated );
    so the problem is on line 10 of the Autogenerated code.

    Bob

    PS I deleted the file you attached as it's no longer needed in the thread.
    benny 07 Oct, 2008
    O ok i dont know what the autogenerated code does, here it is, my php is very limited, any chance of taking a quick look for me?

    <?php
    		if($paramsvalues->dbconnection == "Yes"){			
    			$row =& JTable::getInstance("chronoforms_db3", "Table");
    			srand((double)microtime()*10000);
    			$inum	=	"I" . substr(base64_encode(md5(rand())), 0, 16);
    			$_POST["recordtime"] 	= JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" );
    			$_POST["ipaddress"] 	= JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" );
    			$_POST["uid"] 	= JRequest::getVar( "uid", $inum, "post", "string", "" );
    			$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );			
    			if (!$row->bind( $post )) {
    				echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
    				exit();
    			}				
    			if (!$row->store()) {
    				echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
    				exit();
    			}			
    		}
    		?>
    		


    Thanks🙂
    benny 07 Oct, 2008
    Tried debugging in dreamweaver came up with this error ".$row->getError()." java script error, weather it is relavent or not.
    GreyHead 07 Oct, 2008
    Hi Benny,

    Line 10 is
    if (!$row->bind( $post )) {
    An error here means that Joomla wasn't able to match up the fields in your form with the columns in the chronoforms_db3 database table. Again, this is usually becasue of a problem with bad field names.

    Bob
    benny 07 Oct, 2008
    Thanks for all your help so far Bob

    Ah ok i got it to an other page now

    now this error
    You are not allowed to access this URL directly, POST array is empty
    is this because i have done something to the fields?

    all i did was put " around the part where it goes name=code_1
    and turned it in "name=code_1"

    and the form field name in the autogenerated code tab is empty. when i remove the " it comes back, and wont let me put one there by itself

    i have tried to move the " around but i get the other error again
    GreyHead 07 Oct, 2008
    Hi Benny,

    I'm not quite sure where you are making the changes but almost certainly that should be name="code_1" (quotes around the name value only).

    Bob
    benny 07 Oct, 2008
    ah ok i have made the changed like that
    im just trying a very simple from to try it but i still get the line 10 error

    <DIV class="form_item"   >
    <DIV class="form_element cf_textbox" ><LABEL class="cf_label" >Edit</LABEL><INPUT class="cf_inputbox" id="code_1"  maxLength="150" size="30" name="code_1" ></DIV>
    <DIV class="clear" > </DIV></DIV>
    <DIV class="form_item"   >
    <DIV class="form_element cf_button" ><INPUT  type="submit" value="Submit" ></DIV>
    <DIV class="clear" > </DIV></DIV>


    Thats the code there, i just made it with the wizard. but does not work

    Thanks for helping me out im a real amatuer with this stuff.
    GreyHead 07 Oct, 2008
    Hi Benny,

    Do you know what the column/field names are in your database table?

    You can see them with PHPMyAdmin if you are familiar with it, or the EasySQL Joomla extension is good too.

    Bob
    Max_admin 07 Oct, 2008
    Hi Benny,

    it looks like this is not V3.0 Stable!! which is why you are keep falling into issues, you should upgrade to V3.0 stable first then we can look into those issues because simple they will not happen!

    Cheers

    Max
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    benny 08 Oct, 2008
    Wow the stable version works a charm, i was scared that it was going to break stuff, but everything works on it,

    Thanks for trying to get it working Bob.

    Thanks once again Max for helping me
    Max_admin 08 Oct, 2008
    Ok, great! Thanks!
    Max
    ChronoForms developer...
    Did you try ChronoMyAdmin for managing your Joomla database tables ?
    This topic is locked and no more replies can be posted.