Problem loading mysql

decbuck 27 Nov, 2008
Warning: implode() [function.implode]: Invalid arguments passed in /home/maynooth/public_html/libraries/joomla/database/database/mysql.php on line 534


Hi,
I am getting the following error when I try to write a simple 2 text form to a 2 columns table in a mysql database.

Anyone got any ideas?
GreyHead 27 Nov, 2008
Hi decbuck,

Please post the SQL that causes the error.

Bob
decbuck 27 Nov, 2008
Is this the code you are talking about?
<?php
		if($paramsvalues->dbconnection == "Yes"){
			$user = JFactory::getUser();			
			$row =& JTable::getInstance("test999", "Table");
			srand((double)microtime()*10000);
			$inum	=	"I" . substr(base64_encode(md5(rand())), 0, 16);
			JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
			JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
			JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
			JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
			$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );			
			if (!$row->bind( $post )) {
				JError::raiseWarning(100, $row->getError());
			}				
			if (!$row->store()) {
				JError::raiseWarning(100, $row->getError());
			}
			global $row_test999;
			$row_test999 = $row;
		}
		?>
GreyHead 27 Nov, 2008
Hi decbuck,

Sorry, I forgot you can't get the SQL in the latest version. Please turn on DeBug and paste the Post Array here (it will show as part of the DeBug page info, if you ahve a ReDirect URL please remove it temporarily). Maybe that will give a clue.

Bob
decbuck 27 Nov, 2008
_POST: Array ( [text_1] => hello [text_0] => world [d12d30043967aec15a7a980acadc7d95] => 1 )
GreyHead 27 Nov, 2008
Hi decbuck,

Nothing wrong there - mystifying?

Which versions of Joomla & CF are you using?

The line number is slightly different in my J1.5.8 but I think this is where the problem arises:
$this->setQuery( sprintf( $fmtsql, implode( ",", $fields ) ,  implode( ",", $values ) ) );
The error suggest that one or both of these arrays -$values or $fields - is empty.

Bob
decbuck 27 Nov, 2008
joomla 1.5 and cf 3.0

This is really bugging me now. I want to expand this feature but just trying to get simple example working first.

Thanks for your help. Any more suggestions let me know.
decbuck 27 Nov, 2008
what about general settings for the form.

I have MYSQL statement set to ENGINE, Form Method to Post

Do these matter
GreyHead 27 Nov, 2008
Hi decbuck,

I've never seen this problem reported before for ChronoForms.

Max may have a suggestion . . . , if not we're into hacking the core code to add some diagnostics and see what's happening.

Bob
Max_admin 27 Nov, 2008
Hi guys, no idea here too, try to test sometime and see if anything changes!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
decbuck 28 Nov, 2008
Hi,

Thanks for that. Maybe my database structure is incorrect. I just realised I needa cf_id column in my database. Do I need anything else?
GreyHead 28 Nov, 2008
Hi decbuck,

Copy the form in the Form Manager, then click 'Create Table' for the new version. You can look at the columns in the created table to see hwat is needed in your existing table.

(Or if you have no critical data, just drop the table and create a new one.)

Bob
decbuck 28 Nov, 2008
That is is thanks a million.

I was creating the table myself to match the structure of my form. I should have been using the create table function of cf.

Thanks again.
This topic is locked and no more replies can be posted.