SmileyWar Posted February 4, 2012 Share Posted February 4, 2012 Hiya guys, I'm having problems with a code i have written, it seems that nor google or my own search engine is picking up the links? And i don't understand why. I know the following code has a div on click rule, but i have also added an a href. I tried the basic link which is also not picking up. <?php $old_pattern = array("/[^a-zA-Z0-9]/", "/_+/", "/_$/"); $new_pattern = array("_", "_", ""); $i = '1'; while($row = mysql_fetch_array($result)) { ${videoData_.$i} = mysql_query("SELECT * FROM videoData WHERE qid=".$row['id']."") or die(mysql_error()); ${row_.$i} = mysql_fetch_array(${videoData_.$i}); ${vote_.$i} = mysql_query("SELECT SUM(votes) FROM answers WHERE qid=".$row['id']."")or die(mysql_error()); ${votes_.$i} = mysql_fetch_array(${vote_.$i}); $pagelink = strtolower(preg_replace($old_pattern, $new_pattern , $row['question'])); echo '<div class="NVP-div" '; echo 'onclick="location.href=\'http://www.thevideopoll.com/polls/'; echo $link = "".$row['id']."".$pagelink.".php"; echo '\';" style="cursor: pointer;"'; echo '>'; echo '<img style="float:left; margin-left:25px;" src="http://img.youtube.com/vi/'.${row_.$i}['videoID'].'/default.jpg">'; echo '<p class="NVP-vote">'; echo ${votes_.$i}['SUM(votes)']; echo ' Votes'; echo '</p>'; echo '<br>'; echo '<a class="new-video-links" href="http://www.thevideopoll.com/polls/'; echo $link = "".$row['id']."".$pagelink.".php"; echo '" title="'.$row['question'].'">'; echo "".$row['question'].""; echo "</a>"; echo '</div>'; $i++; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/256393-php-engine-not-picking-up-mysql-while-script/ Share on other sites More sharing options...
SmileyWar Posted February 5, 2012 Author Share Posted February 5, 2012 resolved, it was the search engine not recognizing files without extensions Quote Link to comment https://forums.phpfreaks.com/topic/256393-php-engine-not-picking-up-mysql-while-script/#findComment-1314883 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.