Raptor829 Posted October 15, 2012 Share Posted October 15, 2012 I m working on a site that someone else built. The former programmer used a echo of a sql query to produce a scroll effect across the screen. For some reason its not working. <?php require ('qmbl.php'); $sqlstr = "select i_html from SiteInfo where i_type = 'NEWS_SCROLL'"; $rs_scroll = mysqli_query($sqlstr, $cid); $scroll = mysql_result($rs_scroll,0,0); $sqlstr = "select team_id, t_name from Team t, Settings s where t.t_season = s.cur_season order by t_name"; $rs_teams = mysql_query($sqlstr, $cid); $count=0; $templateTeams=""; while($row = mysql_fetch_assoc($rs_teams)){$templateTeams .= '<a href="team.php?t='.$row['team_id'].'">'.$row['t_name'].'</a><br />'; } //end while ?> Any help will be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/ Share on other sites More sharing options...
Beeeeney Posted October 15, 2012 Share Posted October 15, 2012 Have you tried turning it off and on again? I'm kidding, but you're not echoing anything in that code. Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/#findComment-1385315 Share on other sites More sharing options...
PFMaBiSmAd Posted October 15, 2012 Share Posted October 15, 2012 $rs_scroll = mysqli_query($sqlstr, $cid); ^^^ Someone added an i to your mysql_query() statement. The mysql (no i) and mysqli (with an i) statements cannot be mixed on the same connection and it takes more than just adding an i to convert from mysql to mysqli statements. Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/#findComment-1385316 Share on other sites More sharing options...
Raptor829 Posted October 15, 2012 Author Share Posted October 15, 2012 Later in the code at the <td colspan="2"><div id="scroll"><?php echo $scroll; ?></div> Removed the i but now it just sits there. It used to move from right to left. Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/#findComment-1385318 Share on other sites More sharing options...
ManiacDan Posted October 15, 2012 Share Posted October 15, 2012 Do you have any sort of error_reporting turned on? The bad mysql function call would have thrown a serious error. Turn on error reporting. Also, scrolling of things isn't handled in PHP, only in JS. Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/#findComment-1385321 Share on other sites More sharing options...
Raptor829 Posted October 15, 2012 Author Share Posted October 15, 2012 Ok its working now but like I said it used to moved. What could have happen? Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/#findComment-1385323 Share on other sites More sharing options...
ManiacDan Posted October 15, 2012 Share Posted October 15, 2012 Like I said before, the scroll effect is in a different language, not the one you posted. It's in a whole other file, processed on another computer, and works in a different way. Get firebug or chrome developer tools and check the JS console for errors. Quote Link to comment https://forums.phpfreaks.com/topic/269488-echo-of-a-sql-str-doesnt-work/#findComment-1385336 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.