Jump to content
php.lv forumi

[palīdzat] IPB Chat


Recommended Posts

Es atkal vēršos pie jums jo meklēju forumā neatradu, bet man atsūtija draugs šādu bet tāpat kļūda ir uz 30 rinda bet kas par kļūdu nesaprotu!

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/jzvac/public_html/chat.php on line 30

 

<?php
mysql_connect("localhost","jzvac","1991");
mysql_select_db("jzvac");
$rez=mysql_query("SELECT * FROM tabula ORDER BY lauks");


?>

<?php
$selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']);
while($r=mysql_fetch_array($selekts)) {
if(isset($_POST['ierakstiit'])) {
$ieraksts=$_POST['ieraksts'];
$laiks=time();
$membera_niks=$r['member_name'];
mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('$ieraksts','$laiks','$membera_niks')");
}
}
//Shaadu paarbaudi silti neiesaku lietot :)
if($_COOKIE['member_id'] > 0) {
echo '
<form action="" method="post">
<input type="text" name="ieraksts" />
<input type="submit" name="ierakstiit" />
</form>
';
}
//Un visbeidzot pats selekts
$dati=mysql_query("SELECT * FROM chats ORDER BY laiks DESC");
while($er=mysql_fetch_array($dati)) {
echo $er['niks']."<br />".$er['ieraksts']."<br />";
}
?>

Link to post
Share on other sites

Kā var ielikt tabulu man rāda šādu kļūdu!

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/jzvac/public_html/chat.php on line 11
Table 'jzvac_db.chats' doesn't exist

kad var izlabot šo skriptu vai iedot citu gatavu kas saistīts ar ipb!

Link to post
Share on other sites

Fail :D Savā db pārvaldniekā uztaisi tabulu chats (šajā gadījumā būtu visai izdevīgi taisīt zem ipb db) un attiecīgos laukus, kuri tur parādās: laiks, niks, ieraksts.

Link to post
Share on other sites

ipb datubaze uztaisiju tabulu sadi izskatas

 

CREATE TABLE `chats` (
`ieraksts` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL ,
`laiks` DATE NULL ,
`niks` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL
) ENGINE = MYISAM ;

 

bet palubom nestrada šāds eror

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\web\mon2.php on line 11

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...