cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Fetch data from cforms created tables
September 23, 2008
12:58 pm
bhavesh r
Guest

Please replace the ??? with your data!


[desc]:
_Hi friends,

The data stored in cforms created tables is in vertical format rather than horizontal and I find it difficult to fetch for a display on a different page..

Kindly guide..

thanks in advance

bhavesh ruparelia

September 23, 2008
6:40 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Can you be more specific or give an example?

September 24, 2008
2:12 pm
bhavesh r
Guest

hi oliver,

I have uploaded a mysql database of a cforms form at..

http://www.micromann.com/images/form20.txt

it needs to be imported to your mysql database..

and it is to be displayed as per the image at

http://www.micromann.com/images/form20.JPG

- What I specifically mean is that the data is stored in the database in the vertical column format, while I need to diplay in the page in the horizontal row format..

Kindly guide..

- Also which databse storage format is better in performance- vertical column storage or horizantal row style ?

thanks in advance

bhavesh r

September 24, 2008
6:58 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

When I coded the two cforms tables, I wanted  to keep the foot print and data use minimal. In your example you replicate sub_date & email across all fields, all the time.

Performance wise, it doesn't matter much and if it really did (millions of users on your blog) I'm sure this SQL part is the least of your worries. ;-)

To access the entries more conveniently I'll add PHP routines (ilke a semi 'API') with version 9.

September 25, 2008
7:25 am
bhavesh r
Guest

thanks oliver..

When do you expect to launch the version 9 with the semi api solution ?

thanks & goodluck

bhavesh r

September 25, 2008
7:33 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

I can send you a beta per email.

Launch may happen anywhere in the next 5-10 days.

September 25, 2008
5:37 pm
bhavesh r
Guest

oliver,

If there is a solution to fetch-display the data in the beta as mentioned in your reply…kindly send the beta to my email admin@micromann.com

thanks & goodluck

bhavesh r

September 25, 2008
7:11 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

with v9, there is a function call you can make:

$results = get_cforms_entries($fname,$from,$to,$sort,$limit);

which will return an array with the search results. simply do a print_r($results); to see what the array looks like.

then simply run a forwaech loop and render the contents in whatever fashion you like.

  • $fname =
    any form name text pattern
  • $from, $to =
    any date, format: "Y-m-d H:i:s"
  • $sort =
    form_id, id, sub_date, ip or email
  • $limit =
    # of results, '' = no limits (empty string)
September 26, 2008
6:49 am
bhavesh r
Guest

thanks a lot oliver..

I'll try v 9.0 beta now..

thanks again

bhavesh r

September 27, 2008
8:35 am
bhavesh r
Guest

thanks for the beta version..

- The problem is that this fetch function is working in wordpress environment only ( it doesn't work directly ina php page ) and we need a plugin which lets us embed php seamlessly..

- we are using runphp plugin| php-exec for the same but code is not hidden through this plugin and code is displayed on the page rather than the database display that we want..

- I await your comments on this..

thanks

bhavesh

September 27, 2008
8:54 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

true, but at the least you can borrow the code from the new function (lib_aux.php)

November 3, 2008
4:49 pm
bhavesh r
Guest

oliver,

I request you to advice on the following…

Is it possible to store the cforms data in the horizontal format in the database  instead of the present vertical format by changing some coding ?

Our developers are accustomed to working in the horizontal data format in the database..Since fetching etc becomes easier if the data is stored in the horizonatl format..

thanks in advance

bhavesh r

November 3, 2008
10:31 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Is it possible to store the cforms data in the horizontal format in the database  instead of the present vertical format by changing some coding ?

It depends on your coding skills (PHP + MySQL). I recommend you turn off cforms own DB tracking and add your code to my-functions.php.

November 7, 2008
1:41 am
Jon Bounds
Guest

This looks just what I'm after, but calling the function is just printing the SQL query direct to the page.

I'm sure I'm doing something wrong – but what?

November 7, 2008
2:25 am
Jon Bounds
Guest

It returns:

SELECT * FROM wp_circus_cformssubmissions WHERE form_id IN ('2') ORDER BY id LIMIT 0,<br>SELECT * FROM wp_circus_cformsdata WHERE sub_id IN ()<br>

as if it has been echo'd, and any variable I set to get_cforms_entries()
is empty
November 7, 2008
7:53 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline
  1. you need to use 'my_cforms_action()' and add your code to this function
  2. you code above is a SELECT statement, I would have expexted an INSERT

This looks just what I'm after, but calling the function is just printing the SQL query direct to the page.

what function, when?

November 7, 2008
10:58 am
Jon Bounds
Guest

Sorry, don't understand at all – the help file says:

get_cforms_entries('','','','','') will "return a set of stored form submissions in a multi-dimensional array."

using code in a wordpress template file eg:

 $Names =get_cforms_entries( 'Social media surgery signup', '', '', '', '' );
print_r ($Names);

should in theory print to the browser the array – so i can investigate the structure and then write the php to output what I want. It doesn't. (btw the code is outside the WP 'loop', but that shouldn't me an issue?).

The function prints what looks like an MYSQL query to the  html page, and the array prints as empty:

SELECT * FROM wp_circus_cformssubmissions WHERE form_id IN ('2') ORDER BY id LIMIT 0,
SELECT * FROM wp_circus_cformsdata WHERE sub_id IN ()
Array ( )

Looking at the HTML code the "query" has <br/>s in it. Trying to build an MYSQL query and use statement only bring up an error that the query  doesn't work.

So either the help file could do with a little extra into, or there's a bug/issue with my set-up.

November 7, 2008
12:57 pm
bhavesh
Guest

thanks..

1.you need to use 'my_cforms_action()' and add your code to this function

2. How to know the text box name or select box name for the insert query ?

thanks in advance

bhavesh r

November 7, 2008
5:21 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

I'm confused as to what you want: earlier you said:

Is it possible to store the cforms data in the horizontal format in the database  instead of the present vertical format by changing some coding ?

..which indicated to me that you're looking to use some mechanism to feed submitted data into your own tables, no?

November 7, 2008
6:09 pm
Jon Bounds
Guest

I''m not trying to insert, I'm trying to get data out as per the instructions.

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3740

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5340

Posts: 18707

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)