我一直试图通过Lightface弹出窗口将我的streamitem_id发送到我喜欢的页面。我可以使用普通链接执行此操作,因为我有喜欢的页面显示谁喜欢帖子。但是当我尝试使用javascript发送id时,我没有做同样的事情。
这就是我所拥有并试图做的事情。
<script>
window.addEvent('domready',function(){
document.id('start').addEvent('click',function() {
var number1=".$streamitem_data['streamitem_id'].";
light = new LightFace.IFrame({ height:400, width:800, url:'http://www.rawfeeds.co.uk/include/likes.php?streamitem_id='+number1+'', title: 'Likes' }).addButton('Close', function() { light.close(); },true).open();
});
});
</script>
我的选择中出现错误,因此将streamitem_id打印出来并且没有显示。所以我很确定它给了我这个,因为没有id被发送过来。
Array ( [streamitem_id] => .$streamitem_data['streamitem_id']. ) SELECT Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '['streamitem_id']. AND feedback_rating=1' at line 1
SQL
<?
if (isset($_GET['streamitem_id'])){
print_r($_GET);
$likes = mysql_query('SELECT feedback_streamid,feedback_userid,feedback_rating FROM streamdata_feedback WHERE feedback_streamid='.$_GET['streamitem_id'].' AND feedback_rating=1') or die("SELECT Error: ".mysql_error());
$numRowslikes= mysql_num_rows($likes);
while($row = mysql_fetch_array($likes)){
echo" $likes";