I have db with column named “link”.
Links have redirect urls, which I want to change.
I have php script, which would take the link and gives me output as follows:
$redo = get_redirect('htp://www.mydomain.com/long/url/here&ID=123');
print_r($rez);
this is the output:
Array
(
[0] => htp://www.otherdomain.com
)
how do I loop all items in my database, and run this script for each item.
my db is called “apps” and table is called “items” and column containing urls is called “link” above php script is called getredirect.php
Also when I run script I need to run without the “&ID=123&otherstuff=whatever”
(htp supposed to be http… I can’t add links per board rules)
Can you just do a simple select and put it in an array, and loop through it?
Not sure whether it helps, your question is kinda unclear to me.
If you aren’t sure of the output, you can put a
print_rstatement, i.e.,This would help you understand the PHP code clearer