Ive got a problem with an SQL query in a plugin im writing. Im trying to pass an array into a MySQL Query, but im having some problems. Every time i try the plugin in my browser, I get redirected to the Error #905 (Wrong URL) error page. No mysql error, nothing. Whats going on? Ive tried passing the array into a variable, then serializing it, ive tried converting the variable but nothing seems to work. Any ideas? Thanks.
Serialize should do it. Please provide some of your code. Error 950 could be because you're importing a variable which doesnt hold the right datatype. As far as i know this only happens if the last parameter of sed_import is set to true.
It could be that im not using serialize properly. Ive never used it before, and all i know about it is what ive read on the internet
I should probably explain what im trying to do first. Im trying to modify the Seditio gallery plugin to display multiple galleries on the same page. So for example, /plug.php?e=gallery&f=2|4|1 will display pictures from gallery 2, 4 and 1. So what ive done is imported $f, exploded it, then looped through each gallery.
ha ha yes it looks like i made a typo. I don't think this is the problem though... ive had serialize working properly when i was messing around with it before but it still wasn't working for me. How would I serialize $collections[$count]? When I tried it before, $collections['1'] out puts as s:1:"1"; which of course just gives me an SQL error. I guess i dont quite understand how serialize works.
EDIT:
I think ive found out what is causing the 905 error. After the second SQL query theres a line
sed_die(mysql_num_rows($sql_pff)==0);
which is causing it to die. should have seen this earlier. So this means that the SQL queries are failing and not finding anything....
Added 16 minutes later:
Ahh stupid me. I figured it out. The sed_import for $f was wrong, 2|3|5 is not a int. I set it to txt and now it works
Dieser Beitrag wurde von Sean (am 30. Oktober 2009, 03:59, vor 16 Jahre) bearbeitet
Why use url.php?f=1|2|3 if you can just use url.php?f=1&f=2&f=3 ? This will make $f an array automatically so you don't need to explode it. This is de default way in which checkboxes and multiple selects get sent with the GET method.