Jump to content
php.lv forumi
Sign in to follow this  
FeNzIee

Problema! Palidziba steidzigi vaidziga! :(

Recommended Posts

Es īpaši neko nesaprotu tajos kodos tāpēc uzrakstīju šeit.

Lūdzu palīdziet, esiet tik mīļi.

 

 

Rekur ir problēma!

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\******\******\vuser.php on line 18

 

KODS : http://paste.php.lv/18569d2f6809d00d29068a117b581e08?lang=php

 

Vēl viena problēma

 

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\******\******\*********\lastcom.php on line 3

 

KODS: http://paste.php.lv/4719269f15de7109f8967c0c44ecff3f?lang=php

 

Izmantoju AppServ.

Share this post


Link to post
Share on other sites

1.

$eRes = mysql_query("SELECT * FROM ibf_member_extra WHERE id = $member[id]"); // Nevar arrayu likt!

 

Pameiģini:

$u_id = $member['id'];
$eRes = mysql_query("SELECT * FROM ibf_member_extra WHERE id = '$u_id' ");

 

2.

Tev nav nodefinēts: DB_prefix

Share this post


Link to post
Share on other sites

1.

$eRes = mysql_query("SELECT * FROM ibf_member_extra WHERE id = $member[id]"); // Nevar arrayu likt!

 

Pameiģini:

$u_id = $member['id'];
$eRes = mysql_query("SELECT * FROM ibf_member_extra WHERE id = '$u_id' ");

 

2.

Tev nav nodefinēts: DB_prefix

 

 

Pirmais aizgāja :)

 

Ka to otro saprast? Es esmu nulle tajos kodos atvaino :(

Share this post


Link to post
Share on other sites

define('DB_prefix', '');

Share this post


Link to post
Share on other sites
$c_res = mysql_query("SELECT * FROM " .DB_prefix. "comments ORDER BY date DESC LIMIT 5");
while($c_row = mysql_fetch_array($c_res)) {

Share this post


Link to post
Share on other sites

Rekur es uzliku visu ka vaig,bet tik un ta neiet ! ;(

 

<?
define('DB_prefix','prefix_');
$c_res = mysql_query("SELECT * FROM " .DB_prefix. "comments ORDER BY date DESC LIMIT 5");
while($c_row = mysql_fetch_array($c_res)) {
switch ($c_row['type']) {
case "news":
$url = main_WEB_URL."newss/".$c_row['parentID'];
break;
case "img":
$url = main_WEB_URL."picture/".$c_row['parentID'];
break;
case "videos":
$url = main_WEB_URL."video/".$c_row['parentID'];
break;
case "user":
$url = main_WEB_URL."user/".$c_row['parentID'];
break;
}
 $c_row['comment'] = $main->bbcode->bbcode2zero($c_row['comment']);
echo "<div class='lastcom'><div style='display:inline;text-decoration:none;'>
<a href='$url'>".smaller($c_row['comment'], 15)."</a>
</div></div><br />";
}
?>

Share this post


Link to post
Share on other sites

Tak vienkārši izņem to PREFIX konstanti ārā, ja tev nav prefiski tabulām. Dooh!

Share this post


Link to post
Share on other sites

prefix_comments

prefix_news

un u.t.t.

 

Tie ir tabulu nosaukumi, īstie?

 

Nu okeh, tagad definē prefiksu:

 

define('PREFIX', 'prefix_');

 

Kā tā varētu būt...

Share this post


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...
Sign in to follow this  

×
×
  • Create New...