Jump to content

how to parse an array into variables


dflow

Recommended Posts

hi im trying to extract the results fetched in this while loop as $var1,$var2 etc until the end of the rows fetched by this query:

<?php

$query="SELECT * FROM Suppliers WHERE CITY='Berlin'";

$result = mysql_query($query) or die(mysql_error());

 

 

while($row = mysql_fetch_array($result)){

echo $row['website_url'];

echo "<br />";

}

?>

 

i would like to continue this as :

$var1=$GET_ROW#1;

$var2=$GET_ROW#2;

$var3=$GET_ROW#3;

 

and so on until the  of the query

 

and then use the variables created in a new loop

 

i hope i am clear

thx

 

Link to comment
Share on other sites

now that i defined my fields how would you guys suggest, i loop through the results:

and one of my fields is a XML URI

what i want to achieve is to load the  XML URI from each row loop through them and eventually parse some realtime data.

 

how would you approach  that?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.