Hi
I'm looking for a piece of code that can turn a sql string into an array.
Here is an example: sqlStr = "SELECT p.id FROM products p WHERE ((p.name = 'im a name' AND p.name2="another name") OR (p.name='always with')) So that i in this array quickly could add another restriction to p.name or another field of my wish.

For instance i want to be able to change the Ajax result of a search og products with only change to minimum price og maximum price.

Do you get the idea or do i need to explain more?
I really appreciate all help!

/Nikolai

hello try this syntax:

$qry1="SELECT * FROM `yourtable`";
$res1=mysql_query($qry1) or die(mysql_error());
while ($qry = mysql_fetch_array($res1)) 
{
   $days[]=$qry['name'];
}
print_r($days);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.