<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : PHP array in MySQL query??</title>
		<link>https://www.cotonti.com</link>
		<description>Laatste forum onderwerpen</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sun, 26 Apr 2026 00:38:05 -0000</pubDate>

		<item>
			<title>GHengeveld</title>
			<description><![CDATA[Why use url.php?f=1|2|3 if you can just use url.php?f=1&amp;f=2&amp;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.]]></description>
			<pubDate>Za, 31 Okt 2009 01:26:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=3438&d=0#post18275]]></link>
		</item>
		<item>
			<title>Sean</title>
			<description><![CDATA[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:&quot;1&quot;; which of course just gives me an SQL error. I guess i dont quite understand how serialize works.<br />
<br />
EDIT:<br />
I think ive found out what is causing the 905 error. After the second SQL query theres a line <div class="highlight"><pre class="php">sed_die(mysql_num_rows($sql_pff)==0);</pre></div>
which is causing it to die. should have seen this earlier. So this means that the SQL queries are failing and not finding anything....<br /><br /><b>Added 16 minutes later:</b><br /><br />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 <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" />]]></description>
			<pubDate>Vr, 30 Okt 2009 03:17:45 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=3438&d=0#post18230]]></link>
		</item>
		<item>
			<title>Kilandor</title>
			<description><![CDATA[The function is serialize not serialise <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" /><br />
<br />
<a href="http://us.php.net/manual/en/function.serialize.php" rel="nofollow">http://us.php.net/manual/en/function.serialize.php</a>]]></description>
			<pubDate>Vr, 30 Okt 2009 02:47:56 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=3438&d=0#post18229]]></link>
		</item>
		<item>
			<title>Sean</title>
			<description><![CDATA[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 <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/tongue.gif" alt=":P" /><br />
<br />
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&amp;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.<br />
<br />
Heres the code:<br />
<br />
<div style="margin:4px 0px 4px 0px"><input type="button" value="Code" onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != '') { this.parentNode.getElementsByTagName('div')[0].style.display = ''; } else { this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; }" /><div style="display:none" class="spoiler"><div class="highlight"><pre class="php">/* ==================================== */
	case 'gallery':
	/* ==================================== */
	
	
	//TESTING
	$f = sed_import('f','G','TXT');
	$collections = explode(&quot;|&quot;, $f);
	$numcol = count($collections);
	
	$count = '0';
	$num = '0';
	
	//$serialized = serialise($collections);
	
	while ($numcol != $count){
		$jj=0;
		$sql_pff = mysql_query(&quot;SELECT f.*, u.user_name FROM $db_pfs_folders f, $db_users u WHERE pff_id=$collections&#091;$count&#093; AND pff_ispublic=1 AND pff_isgallery=1 AND f.pff_userid=u.user_id&quot;) or die(mysql_error());
	
		sed_die(mysql_num_rows($sql_pff)==0);
		$pff = sed_sql_fetcharray($sql_pff);
	
		$sql = mysql_query(&quot;SELECT * FROM $db_pfs WHERE pfs_folderid=$collections&#091;$count&#093; ORDER BY pfs_$cfg_sortby $cfg_sortway&quot;) or die(mysql_error());
		$nbitems = sed_sql_numrows($sql_pff);
		$pff&#091;'pff_title'&#093; = sed_cc($pff&#091;'pff_title'&#093;);
		$userid = $pff&#091;'pff_userid'&#093;;
	
		$t-&gt;assign(array(
			&quot;GALLERY_ID&quot; =&gt; $pff&#091;'pff_id'&#093;,
			&quot;GALLERY_TITLE&quot; =&gt; &quot;&lt;a href=https://www.cotonti.com/\&quot;plug.php?e=gallery&amp;amp;f=&quot;.$pff&#091;'pff_id'&#093;.&quot;\&quot;&gt; &quot;.$pff&#091;'pff_title'&#093;.&quot;&lt;/a&gt;&quot;,
			&quot;GALLERY_SHORTTITLE&quot; =&gt; $pff&#091;'pff_title'&#093;,
			&quot;GALLERY_DESC&quot; =&gt; sed_cc($pff&#091;'pff_desc'&#093;),
			&quot;GALLERY_COUNT&quot; =&gt; $pff&#091;'pff_count'&#093;,
	//		&quot;GALLERY_COMMENTS&quot; =&gt; $pff&#091;'comments'&#093;,
	//		&quot;GALLERY_RATING&quot; =&gt; $pff&#091;'ratings'&#093;,
			&quot;GALLERY_AUTHOR&quot; =&gt; $pff&#091;'author'&#093;
				));
	
	//	$pff&#091;'comments'&#093; = sed_comments('g'.$pff&#091;'pff_id'&#093;);
	//	$pff&#091;'ratings'&#093; = sed_ratings('g'.$pff&#091;'pff_id'&#093;);
	
		while ($pfs = sed_sql_fetcharray($sql))
			{
			$jj++;
			$pfs&#091;'pfs_fullfile'&#093; = $cfg&#091;'pfs_dir'&#093;.$pfs&#091;'pfs_file'&#093;;
			$pfs&#091;'pfs_filesize'&#093; = floor($pfs&#091;'pfs_size'&#093;/1024);
	
			if (($pfs&#091;'extension'&#093;=='jpg' || $pfs&#091;'extension'&#093;=='jpeg' || $pfs&#091;'extension'&#093;=='png') &amp;&amp; $cfg&#091;'th_amode'&#093;!='Disabled')
				{
				if (!file_exists($cfg&#091;'th_dir'&#093;.$pfs&#091;'pfs_file'&#093;) &amp;&amp; file_exists($cfg&#091;'pfs_dir'&#093;.$pfs&#091;'pfs_file'&#093;))
				{
					$pfs&#091;'th_colortext'&#093; = array(
						hexdec(substr($cfg&#091;'th_colortext'&#093;, 0, 2)),
						hexdec(substr($cfg&#091;'th_colortext'&#093;, 2 ,2)),
						hexdec(substr($cfg&#091;'th_colortext'&#093;, 4 ,2))
							);
	
					$pfs&#091;'th_colorbg'&#093; = array(
						hexdec(substr($cfg&#091;'th_colorbg'&#093;, 0, 2)),
						hexdec(substr($cfg&#091;'th_colorbg'&#093;, 2, 2)),
						hexdec(substr($cfg&#091;'th_colorbg'&#093;, 4, 2))
							);
	
					sed_createthumb(
						$cfg&#091;'pfs_dir'&#093;.$pfs&#091;'pfs_file'&#093;,
						$cfg&#091;'th_dir'&#093;.$pfs&#091;'pfs_file'&#093;,
						$cfg&#091;'th_x'&#093;,
						$cfg&#091;'th_y'&#093;,
						$cfg&#091;'th_keepratio'&#093;,
						$pfs&#091;'pfs_extension'&#093;,
						$pfs&#091;'pfs_file'&#093;,
						$pfs&#091;'pfs_filesize'&#093;,
						$pfs&#091;'th_colortext'&#093;,
						$cfg&#091;'th_textsize'&#093;,
						$pfs&#091;'th_colorbg'&#093;,
						$cfg&#091;'th_border'&#093;,
						$cfg&#091;'th_jpeg_quality'&#093;
							);
					}
		 		}
	
			if ($cfg&#091;'plugin'&#093;&#091;'gallery'&#093;&#091;'columns'&#093;==1)
				{
				$pfs&#091;'cond1'&#093; = '&lt;tr&gt;';
				$pfs&#091;'cond2'&#093; = '&lt;/tr&gt;';
				}
			elseif ($jj==1)
				{
				$pfs&#091;'cond1'&#093; = '&lt;tr&gt;';
				$pfs&#091;'cond2'&#093; = '';
				}
			elseif ($jj==$cfg&#091;'plugin'&#093;&#091;'gallery'&#093;&#091;'columns'&#093;)
				{
				$jj=0;
				$pfs&#091;'cond1'&#093; = '';
				$pfs&#091;'cond2'&#093; = '&lt;/tr&gt;';
				}
			else
				{
				$pfs&#091;'cond1'&#093; = '';
				$pfs&#091;'cond2'&#093; = '';
				}
	
	
			$pfs&#091;'picturecode'&#093; = 'g'.$pff&#091;'pff_id'&#093;.'-'.$pfs&#091;'pfs_id'&#093;;
	//		$pfs&#091;'comments'&#093; = sed_comments($pfs&#091;'picturecode'&#093;);
	//		$pfs&#091;'ratings'&#093; = sed_ratings($pfs&#091;'picturecode'&#093;);
			$pfs&#091;'new'&#093; = ($pfs&#091;'pfs_date'&#093;+$cfg&#091;'plugin'&#093;&#091;'gallery'&#093;&#091;'newdelay'&#093;*86400&gt;$sys&#091;'now'&#093;) ? $cfg&#091;'plugin'&#093;&#091;'gallery'&#093;&#091;'newtext'&#093; : '';
	
			if (sed_gallery_ismovie($pfs&#091;'pfs_extension'&#093;))
				{
				$pfs&#091;'pfs_imgsize'&#093; = array ('?','?');
				$pfs&#091;'pfs_imgsize_xy'&#093; = '';
				$pfs&#091;'popup'&#093; = &quot;plug.php?e=gallery&amp;amp;v=&quot;.$pfs&#091;'pfs_id'&#093;;
				}
			else
				{
				$pfs&#091;'pfs_imgsize'&#093; = @getimagesize($pfs&#091;'pfs_fullfile'&#093;);
				$pfs&#091;'pfs_imgsize_xy'&#093; = $pfs&#091;'pfs_imgsize'&#093;&#091;0&#093;.'x'.$pfs&#091;'pfs_imgsize'&#093;&#091;1&#093;;
				$pfs&#091;'popup'&#093; = &quot;javascript:popup('gallery&amp;amp;v=&quot;.$pfs&#091;'pfs_id'&#093;.&quot;',&quot;.($pfs&#091;'pfs_imgsize'&#093;&#091;0&#093;+$cfg&#091;'plugin'&#093;&#091;'gallery'&#093;&#091;'popupmargin'&#093;).&quot;,&quot;.($pfs&#091;'pfs_imgsize'&#093;&#091;1&#093;+$cfg&#091;'plugin'&#093;&#091;'gallery'&#093;&#091;'popupmargin'&#093;).&quot;)&quot;;
				}
	
			if ($usr&#091;'isadmin'&#093;)
				{
				$pfs&#091;'admin'&#093; = &quot;&lt;a href=https://www.cotonti.com/\&quot;pfs.php?m=edit&amp;amp;id=&quot;.$pfs&#091;'pfs_id'&#093;.&quot;&amp;amp;userid=&quot;.$userid.&quot;\&quot;&gt;&quot;.$L&#091;'Edit'&#093;.&quot;&lt;/a&gt;&quot;;
				$pfs&#091;'admin'&#093; .= &quot; &amp;nbsp; &lt;a href=https://www.cotonti.com/\&quot;plug.php?e=gallery&amp;amp;m=edit&amp;amp;a=potw&amp;amp;id=&quot;.$pfs&#091;'pfs_id'&#093;.&quot;\&quot;&gt;&quot;.$L&#091;'gal_setaspotw'&#093;.&quot;&lt;/a&gt;&quot;;
				}
			
			$t-&gt; assign(array(
				&quot;GALLERY_ROW_ID&quot; =&gt; $pfs&#091;'pfs_id'&#093;,
				&quot;GALLERY_ROW_VIEWURL&quot; =&gt; &quot;plug.php?e=galleria&amp;amp;f=&quot;.$pfs&#091;'pfs_folderid'&#093;.&quot;#datas/users/&quot;.$pfs&#091;'pfs_file'&#093;,
				&quot;GALLERY_ROW_VIEWURL_POPUP&quot; =&gt; $pfs&#091;'popup'&#093;,
				&quot;GALLERY_ROW_FILE&quot; =&gt; $pfs&#091;'pfs_file'&#093;,
				&quot;GALLERY_ROW_FULLFILE&quot; =&gt; $pfs&#091;'pfs_fullfile'&#093;,
				&quot;GALLERY_ROW_THUMB&quot; =&gt; sed_gallery_thumb($pfs&#091;'pfs_extension'&#093;, $pfs&#091;'pfs_file'&#093;),
				&quot;GALLERY_ROW_ICON&quot; =&gt; $icon&#091;$pfs&#091;'pfs_extension'&#093;&#093;,
				&quot;GALLERY_ROW_DESC&quot; =&gt; $pfs&#091;'pfs_desc'&#093;,
				&quot;GALLERY_ROW_SHORTDESC&quot; =&gt; sed_cc($pfs&#091;'pfs_desc'&#093;, 64),
				&quot;GALLERY_ROW_DATE&quot; =&gt; date($cfg&#091;'dateformat'&#093;, $pfs&#091;'pfs_date'&#093; + $usr&#091;'timezone'&#093; * 3600),
				&quot;GALLERY_ROW_NEW&quot; =&gt; $pfs&#091;'new'&#093;,
				&quot;GALLERY_ROW_SIZE&quot; =&gt; $pfs&#091;'pfs_filesize'&#093;.$L&#091;'kb'&#093;,
				&quot;GALLERY_ROW_DIMX&quot; =&gt; $pfs&#091;'pfs_imgsize'&#093;&#091;0&#093;,
				&quot;GALLERY_ROW_DIMY&quot; =&gt; $pfs&#091;'pfs_imgsize'&#093;&#091;1&#093;,
				&quot;GALLERY_ROW_DIMXY&quot; =&gt; $pfs&#091;'pfs_imgsize_xy'&#093;,
				&quot;GALLERY_ROW_COUNT&quot; =&gt; $pfs&#091;'pfs_count'&#093;,
	//			&quot;GALLERY_ROW_COMMENTS&quot; =&gt; $pfs&#091;'comments'&#093;,
	//			&quot;GALLERY_ROW_RATING&quot; =&gt; $pfs&#091;'ratings'&#093;,
				&quot;GALLERY_ROW_ADMIN&quot; =&gt; $pfs&#091;'admin'&#093;,
				&quot;GALLERY_ROW_COND1&quot; =&gt; $pfs&#091;'cond1'&#093;,
				&quot;GALLERY_ROW_COND2&quot; =&gt; $pfs&#091;'cond2'&#093;,
				&quot;GALLERY_ROW_TEST&quot; =&gt; $num
					));
			$t-&gt;parse(&quot;MAIN.GALLERY.ROW&quot;);
			}
		$t-&gt;parse(&quot;MAIN.GALLERY&quot;);
		$count++;
	}

	$t-&gt;parse(&quot;MAIN.MENU&quot;);

	break;
</pre></div></div></div>
<br />
Does it have something to do with sed_import do you think?<br />
Thanks a lot for your help!]]></description>
			<pubDate>Vr, 30 Okt 2009 01:28:36 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=3438&d=0#post18228]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[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.]]></description>
			<pubDate>Thu, 29 Okt 2009 15:18:52 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=3438&d=0#post18223]]></link>
		</item>
		<item>
			<title>Sean</title>
			<description><![CDATA[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.]]></description>
			<pubDate>Thu, 29 Okt 2009 03:41:40 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=3438&d=0#post18219]]></link>
		</item>
	</channel>
</rss>