Link to home
Start Free TrialLog in
Avatar of wkpreferredsolutions
wkpreferredsolutions

asked on

Links Not Displaying IN PHP Query/Spider Results

Hello,

I have a very simple database display script that pulls loops through the db ad retrieves a listing of articles in a table.

Here are the variables:

bo_id = Article ID
bo_title = Article Title

Here is the script below:

<?
$query="select * from biz_ops";

$result=mysql_query($query)
    or die(mysql_error());
echo "<table border=1>";

while ($row=mysql_fetch_object($result))
{
echo "<tr>";
echo "<td>Article ID:</td><td>$row->bo_id</td>";
echo "<td>Title:</td><td><a href='http://www.mysite.com/articles/$row->bo_id'>$row->bo_title</a></td>";
echo "</tr>";
}

echo "</table>";

mysql_close();

?>

Here is the line that actually creates my link to each article:

echo "<td>Title:</td><td><a href='http://www.mysite.com/articles/$row->bo_id'>$row->bo_title</a></td>";

This works great when I run the script on my site, BUT when I use a search engine spider simulation script it only shows the content displayed on the page and it won't recognize the links created by the script.

Here's a brief overview of how the spider simulator shows what it finds:

Article ID: 1 Title: Evaluate Online Needs For Others Article ID: 2 Title: Open An Import Shop Article ID: 3 Title: Turn Trash To Cash Article ID: 6 Title: Perform PR Services Article ID: 7 Title: Sponsor A Sports Site For Community Teams Article ID: 8 Title: Become A CyberAssistant Article ID: 9 Title: Found A Research Firm Article ID: 10 Title: Publish Newsletters For Yourself Or Other Biz Article ID: 11 Title: Begin A Promotional Biz

Now if I ad a hard coded link following my script, such as <a href="http://www.google.com">google</a> it will recognize this as an actual link and report it in the "Links found" section of the spider report.

Am I just coding my links in my script incorrectly and they are displaying when the spider parses the page?  Is there a way to make this work?  Here is the link to the spider I'm using to test my pages:  http://www.searchengineworld.com/cgi-bin/sim_spider.cgi

Thanks in advance,

Trent
ASKER CERTIFIED SOLUTION
Avatar of lozloz
lozloz

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 wkpreferredsolutions
wkpreferredsolutions

ASKER

Thanks loz,

This was the KEY!!!

otherwise you can try replacing mysql_fetch_assoc for mysql_fetch_object and try:

echo "<td>Title:</td><td><a href=\"http://www.mysite.com/articles/" . $row["bo_id"] . "\">" . $row["bo_title"] . "</a></td>";

Thanks for the HELP!!

BTW, here is the link to the Spider Simulator if you ever have a need for it.  The link I posted earlier was wrong, this one doesn't require a login.
http://www.searchengineworld.com/misc/tools.htm

If you want to see the output I get (after your fantastic answer) just query this url:

http://www.homebizprimer.com/2ndquery.php

Thanks again!!

Trent

BTW:  I bumped the points up some for you.
glad to help

loz