Smarty ve bir kullanım sorunu

0 Cevap php

I have a problem in using Samrtm Mysql and Jquery or Ajax and if I use a div auto reloader it shows a php error .. these are my files: accept.html (Template)

{literal}
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#invite').load('accept.php').fadeIn("slow");
}, 1000);
</script>
{/literal}
<div id="invite">
<fieldset>
<legend>Invites</legend>
{section name=ct loop=$invites}
You have an invite {$sender.user}<br />
<a href="?action=accept_contest&sid={$invites[ct].sendid}">Accept</a> | <a href="?action=cancel_contest&sid={$invites[ct].sendid}">Cancel</a>
{/section}
</fieldset>
</div>

accept.php (Ana dosyası)

<?php

$time = date("i:s",time("s"));
$sql_select_invite = mysql_query("SELECT * FROM invite WHERE recid = '$_SESSION[id]' AND accept = '0' AND endtime > '$time'");

while($invite = mysql_fetch_array($sql_select_invite)){
 $sender = mysql_fetch_array(mysql_query("SELECT * FROM member WHERE id = '$invite[sendid]'"));
    $contest->assign("sender", $sender);
    $invites[] = $invite;
}
$contest->assign("invites", $invites);

?>

and when I use the Jquery thing or Ajax it shows this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\somefo\accept.php on line 6

Fatal error: Call to a member function assign() on a non-object in C:\AppServ\www\somefo\accept.php on line 11

I don't know why it shows this .. and I hope you answer me and what or how to solve this problem

Teşekkürler ..

0 Cevap