Strange happenings

Status
Not open for further replies.

markbhai1

New Member
Something seems to have gone wrong with my site (which is in development)

Data is not being saved from my custome form and I get the following message when trying to upload a CSV file into a new table

A table must have at least 1 column SQL=CREATE TABLE P ( primary key (fabrik_internal_id))

I thought I may have damaged something so I have reloaded the latest SVN and syill have the same problem.

M
 
Sounds like two separate issues. Lets deal with the customer form first.

Is it giving you an error when you submit the form? If not, do you have a jump page set? If so, temporarily remove the jump page URL and try again, see if it prints out an error after submission. If so, paste it here.

-- hugh
 
Hint needed - adding php on form execution

I fixed the above now but cant seem to get the "php code to execute on form submission" bit going despite trying a few different ways.

Say for example I want to set a date to contact someone based on their status so if status =1 then date should = today +5.

In the php code to execute' ....

how do write the php, do I use the <?php brackets etc or is this added by fabrik?
how do I refer to a field on my form? e.g. 'properties___status_id' as if i were writing it directly on the template?

If I set a value on a field does the submit button change this in any way?

Thanks

Mark.
 
I have some more progress but could do with some help as to what I am doing wrong now.

I have added the following code which I am using to test the simple functionality...

global $database;
$paddr = mosGetParam($_POST, 'properties___property_address');
$uid = mosGetParam($_POST, 'properties___property_id');
$sql = "UPDATE properties SET post_code = $paddr WHERE property_id = $uid";
$database->setQuery($sql);
$database->query();
echo $database->getQuery();
echo $database->getErrorMsg();
exit;

But when I submit the form I get the following error...

UPDATE properties SET post_code = The Hollies WHERE property_id = 1

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'Hollies WHERE property_id = 1\' at line 1 SQL=UPDATE properties SET post_code = The Hollies WHERE property_id = 1

To me the SQL looks OK so I can't figure why I get the error.

Thanks

Mark.
 
Data is not being saved from my custome form and I get the following message when trying to upload a CSV file into a new table

A table must have at least 1 column SQL=CREATE TABLE P ( primary key (fabrik_internal_id))

M

What was the name of the table you were specifying? How did you solve this? I had the same problem and by the looks of it it was because i was not using lowercase in the table name...
 
Hi Cyber.

I ended up solving it by re-installing. I guess this would not be much of a help, but, I am currently still developing my site and am taking regular copies of it so it was no great shakes for me.

Cheers

Mark.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top