How can I turn a string below into an array?
pg_id=2&parent_id=2&document&video
This is the
This is the PHP code to split query in mysql & mssql
enter code here
function splitquery($strquery)
{
$arrquery=explode('select',$strquery);
$stry='';$strx='';
for($i=0;$i1)
{
$strx=trim($arrquery[($i-1)]);
if(trim(substr($strx,-1))!='(')
{
$stry=$stry.'
select '.trim($arrquery[$i]);
}
else
{
$stry=$stry.trim('select '.trim($arrquery[$i]));
}
$strx='';
}
}
return $stry;
}
Example:
select xx from xx select xx,(select xx) from xx where y=' cc' select xx from xx left join ( select xx) where (select top 1 xxx from xxx) oder by xxx desc ";
select xx from xx
select xx,(select xx) from xx where y=' cc'
select xx from xx left join (select xx) where (select top 1 xxx from xxx) oder by xxx desc
Thank you, from Indonesia Sentrapedagang.com