I'm using the latest copies of views and cck.
I got this error
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/includes/database.mysql.inc on line 349.
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/includes/database.mysql.inc on line 349.
I had this problem before intermittently.
I did a little reading. It may have to do with multiple select check boxes.
What I'd like to do now is figure out how to debug. I'd like to learn how to debug it since this problem is intermittent. What statements do I use to figure out what the problem is?
I think I read about a print_vars or something but I imagine there are a lot of ways, some better than others.
How would you go about debugging this? thank you
Comments
here is the code for the view
$view = new stdClass();
$view->name = 'booksbycountry';
$view->description = 'books by country';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'books sorted by country';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'booksbycountry';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title',
'handler' => 'views_handler_field_nodelink',
),
array (
'tablename' => 'node_data_field_city',
'field' => 'field_city_value',
'label' => '',
'options' => 'default',
),
);
$view->filter = array (
array (
'tablename' => 'node_data_field_topic1',
'field' => 'field_topic1_value_default',
'operator' => 'OR',
'options' => '',
'value' => array (
),
),
);
$view->exposed_filter = array (
array (
'tablename' => 'node_data_field_topic1',
'field' => 'field_topic1_value_default',
'label' => '',
'optional' => 0,
'is_default' => 0,
'operator' => 0,
'single' => 0,
),
);
$view->requires = array(node, node_data_field_city, node_data_field_topic1);
$views[$view->name] = $view;
empty field
maybe I have an empty field and that's the problem. I can't read this code, but if someone tells me what parameter 1 is, I'll check if it's empty.
found this
http://drupal.org/node/77828
Fatal error: Cannot use object of type stdClass as array
devel
very funny. I made a new sandbox. copied everything over. installed devel. opened the view. no error message.
the error message was still present in the real site. I finally got rid of it by closing the browser and reopening the browser.
the problem is intermittent so it may come back. or it seems it happens when a view has never been viewed.
I will add that looking at the variable viewer in devel didn't help much. there are quite a few arrays on this page so I don't know which one is giving the trouble.
I thought I can use devel to insert print statements in a module. but i don't see any place to do that.
yon are trying to save something different than a string in db
probably an array, or so.
HTH, Renaud
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Renaud Richardet renaud [at] apache.org www.oslutions.com
Check the filters for the View
I had the same issue on one page with a custom view. Everything was fine on my dev server, but the live site had the problem. I went into the view and even though filters were listed, they were blank for some reason. I deleted the blank filters and re-added the desired filters. After that, the error went away.
You can follow these steps:
1. Go to Administer
2. Views
3. Edit on the View that has the problem
4. Check the filters
i'm sorry to bump this topic,
i'm sorry to bump this topic, but i got the same problem and i don't have any blank filters...
Subscribe
Same here - no blank filters.
Same here. And indeed no
Same here. And indeed no blank filters either.
Has anyone already noticed an actual issue on their site, related to this message? Does this problem actually mess something up or not?
Yeah, I'm seeing something very similar to this...
I've just taken over admin for a pretty complex drupal site - copied over all files, duplicated the database etc... and am seeing a confounding difference between the live and development versions - basically this code:
This code returns the entire node in the database on the LIVE server, but is missing a few important fields when viewed on the dev server. I've updated a few modules during debugging that I suspected may be related (like the "emfield" since one of the missing fields is a Video field - with no affect.
Some additional texture - if I EDIT the node in either environment, all of the data is there, but if I view the node directly (server.com/node/xxx) i get the same issue — so the data is there!
Could this be related to the above? I'm a little stymied and need these sites to behave identically before I can get started on active development.
Thanks in advance.
Solved. Turned out
Solved. Turned out contemplate was to blame - it had turned itself off for the template in question on the move from Live to Dev - I assumed that was in the database, but perhaps not? If so, it should've been applied as I just duplicated the DB. Anyway, edited the template, checked "effected by contemplate" and problem solved.
Hey, can you please elaborate
Hey, can you please elaborate on how you solved this problem. Which template did you edit. I'm very new to Drupal so if you could tell me in simple terms I'd really appreciate it. thanks!