Link to home
Start Free TrialLog in
Avatar of OldHatt45
OldHatt45

asked on

split, REG_EMPTY, and jQuery

I have a case where I'm trying to use "jCarosel".  I have setup a database query (which does work) and returns a result set.  The result set is then brought back into a string variable via mysql_fetch_assoc, using "||" as the field separator.

I then instantiate the array I want to use ($images = array(); ).
The very next thing I do is $images = split('||', $StringToReturn2);

To verify that the $StringToReturn2 does in fact contain results I do an "echo $StringToReturn2;" immediately before the array is established.

I get the following error message:
<b>Warning</b>:  split() [<a href='function.split'>function.split</a>]: REG_EMPTY in <b>C:\inetpub\wwwroot\BACE\jcarousel\examples\dynamic_ajax_php_BACEMod.php</b> on line <b>71</b><br />
1<br />

I think this is telling me that the $StringToReturn2 variable is empty, but I'm not sure.  
I need to get this going and I don't understand why the error.

Thanks in Advance

OldHatt45
$StringToReturn2 = "http://sentinel/BACE/";  //Prepend root location to each value returned.
      while ($row_rsBACEstkType2 = mysql_fetch_assoc($rsBACEstkType2)) { 
	    foreach($row_rsBACEstkType2 as $value1) {
		  $StringToReturn2 .= $value1.'||http://sentinel/BACE/';
		  
	    }
      } 
	  echo $StringToReturn2;
	  $images = array();
	  $images = split('||', $StringToReturn2);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ziffgone
ziffgone
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OldHatt45
OldHatt45

ASKER

Gentlemen
Both solutions worked!  I just need to see which of the 2 I will actually use.  Since I looked at the answers you both gave at the same time, I feel it only fair to split the points.  Hope this is OK with both of you.

Thank You again

OldHatt45
Gentlemen and/or Ladies,
Both solutions worked! Both solutions were "simple" and clear and provide me with what I need.  I just need to see which of the 2 I will actually use. Since I looked at the answers you both gave at the same time, I feel it only fair to split the points. Hope this is OK with both of you.

Thank You again

OldHatt45