AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters > Web Development
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Web Development Java/PHP/Perl/ASP and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Dec 9, 2005, 18:53   #1
йес эм эли...
 
Mesrop's Avatar
 
Join Date: Feb 2005
Location: near the computer
Posts: 3,202
Rep Power: 4
Reputation: 89
Send a message via ICQ to Mesrop Send a message via AIM to Mesrop Send a message via MSN to Mesrop Send a message via Yahoo to Mesrop Send a message via Skype™ to Mesrop
mysql_num_rows() Problem

hi! chto mne delat'?
script em grel, LOCAL-is vra (MySQL 3.23.53-max-nt)normal a. bayc serveri vra (MySQL 4.0.25-standard) es errorn a talis...

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mesrop/public_html/script.php on line 15


et toxer@ hamapatasxanum en es hatvaci meji cod-in...
PHP Code:
mysql_connect("localhost""mesrop_user""pass");
mysql_select_db("mesrop_db");
$query="select name, hamar from ".$lng;
$res=mysql_query($query);
echo 
$table.$tr.$td_head._from.$td_end.$td_head._to.$td_end."<form name=form action=main.php method=get>";
$q=$tr.$td_res."<select name=from>";
  
$num=mysql_num_rows($res);
  for (
$i=0$i<$num$i++)
  {
  
$row=mysql_fetch_array($res);
$q=$q."<option value=".$row[1].">".$row[0]."</option>"
}
$q=$q."</select>".$td_end
please. help me....
Mesrop is offline   Reply With Quote Quote selected
Old Dec 9, 2005, 20:14   #2
Banned
 
Forever Child's Avatar
 
Join Date: Oct 2001
Location: ...осень колибри
Posts: 7,493
Rep Power: 0
Reputation: 10
Send a message via ICQ to Forever Child Send a message via AIM to Forever Child Send a message via Yahoo to Forever Child
Re: mysql_num_rows() Problem

Может быть так, что запрос ничего не выдает?

Попробуй написать так
$res=mysql_query($query) or die("MySQL query '" . $query . "' failed");
Forever Child is offline   Reply With Quote Quote selected
Old Dec 9, 2005, 20:23   #3
Какое небо, бля, Багдад!
 
knightmare's Avatar
 
Join Date: Oct 2005
Location: Ереван
Posts: 1,659
Rep Power: 3
Reputation: 77
Re: mysql_num_rows() Problem

Скорее всего не та таблица и/или остальная часть запроса, вот и результат не "ресурс", а код возврата обработанного запроса.
2Forever Child: не видел поста
__________________
мордой об лавку
LISP is the only language that is truly beautiful.
d
.

Хочу трахнуть Nissan Skyline R34, и ездить на Alessandra Ambrosio
knightmare is offline   Reply With Quote Quote selected
Old Dec 10, 2005, 09:58   #4
йес эм эли...
 
Mesrop's Avatar
 
Join Date: Feb 2005
Location: near the computer
Posts: 3,202
Rep Power: 4
Reputation: 89
Send a message via ICQ to Mesrop Send a message via AIM to Mesrop Send a message via MSN to Mesrop Send a message via Yahoo to Mesrop Send a message via Skype™ to Mesrop
Ответ: mysql_num_rows() Problem

PHP Code:
<? 
$l
=0;
  if(
$l==0)$lng="street";
    elseif(
$l==1)$lng="arm";    
    else 
$lng="eng";
    
mysql_connect("localhost""mesrop_user""pass");
mysql_select_db("mesrop_db");
$query="select name, hamar from ".$lng;
$res=mysql_query($query) or die("MySQL query '" $query "' failed");
echo 
$table.$tr.$td_head._from.$td_end.$td_head._to.$td_end."<form name=form action=main.php method=get>";
$q=$tr.$td_res."<select name=from>";
  
$num=mysql_num_rows($res);
  for (
$i=0$i<$num$i++)
  {
  
$row=mysql_fetch_array($res);
$q=$q."<option value=".$row[1].">".$row[0]."</option>"
}
$q=$q."</select>".$td_end;
echo 
$q;


$query="select name, hamar from ".$lng;
$res=mysql_query($query);
$q1=$td_res."<select name=to>";
  
$num=mysql_num_rows($res);
  for (
$i=0$i<$num$i++)
  {
  
$row=mysql_fetch_array($res);
$q1=$q1."<option value=".$row[1].">".$row[0]."</option>"
}
$q1=$q1."</select>".$td_end.$tr_end.$tr.$td."&nbsp;".$td_end.$td_res_r."<input type=submit value="._find.">".$td_end;
echo 
$q1;
echo 
"</form>";
 
?>
hesa et amjoxch fail@. serveri vra error a talis, locali vra chotki a...
himael gruma MySQL query 'select name, hamar from street' failed
esqani mej inchna sxal?
Mesrop is offline   Reply With Quote Quote selected
Old Dec 10, 2005, 10:07   #5
йес эм эли...
 
Mesrop's Avatar
 
Join Date: Feb 2005
Location: near the computer
Posts: 3,202
Rep Power: 4
Reputation: 89
Send a message via ICQ to Mesrop Send a message via AIM to Mesrop Send a message via MSN to Mesrop Send a message via Yahoo to Mesrop Send a message via Skype™ to Mesrop
Ответ: mysql_num_rows() Problem

lav. lav. dzeci! shat mersi Forever Child ev knightmare !

$query="select name, hamar from ".$lng;
phoxeci
$query="select name, hamar from street";
ashxatec...
bayc chgitem xi nenc cher ashxatum... meka nenc phophoxakan@ tvel ei...
amen depqum mersi!
Mesrop is offline   Reply With Quote Quote selected
Old Dec 18, 2005, 08:54   #6
Вечный Студент
 
Leo's Avatar
 
Join Date: Oct 2003
Location: Armenia
Posts: 69
Rep Power: 0
Reputation: 10
Send a message via ICQ to Leo
Re: Ответ: mysql_num_rows() Problem

Harmar e ogtagorcel:
$res=mysql_query($query) or die(mysql_error());
Miangamic erevum e zaprosi sxal'.
Udachi.
Leo is offline   Reply With Quote Quote selected
Old Feb 1, 2006, 08:05   #7
йес эм эли...
 
Mesrop's Avatar
 
Join Date: Feb 2005
Location: near the computer
Posts: 3,202
Rep Power: 4
Reputation: 89
Send a message via ICQ to Mesrop Send a message via AIM to Mesrop Send a message via MSN to Mesrop Send a message via Yahoo to Mesrop Send a message via Skype™ to Mesrop
Ответ: mysql_num_rows() Problem

Еще один вопрос...
inchpes kareli e MySQL -ic, hanem text -i mi mas@.
aysinqn ete TEXT -@ 100 simvol uni, indz ta 20 simvol@...
mekel pliz, aseq te vortexa drvum et parametr@...
im mot queryn senca
Code:
select TEXT from `news` order by `id` desc
Mesrop is offline   Reply With Quote Quote selected
Old Feb 1, 2006, 10:32   #8
Борец с бояном
 
Sauron's Avatar
 
Join Date: Jun 2003
Location: Yerevan
Posts: 21,440
Rep Power: 10
Reputation: 46
Re: Ответ: mysql_num_rows() Problem

Quote:
Originally Posted by mesrop
Еще один вопрос...
inchpes kareli e MySQL -ic, hanem text -i mi mas@.
aysinqn ete TEXT -@ 100 simvol uni, indz ta 20 simvol@...
mekel pliz, aseq te vortexa drvum et parametr@...
im mot queryn senca
Code:
select TEXT from `news` order by `id` desc
select substring(TEXT,1,20) as TEXT from `news` order by `id` desc
Sauron is offline   Reply With Quote Quote selected
Old Feb 1, 2006, 15:46   #9
йес эм эли...
 
Mesrop's Avatar
 
Join Date: Feb 2005
Location: near the computer
Posts: 3,202
Rep Power: 4
Reputation: 89
Send a message via ICQ to Mesrop Send a message via AIM to Mesrop Send a message via MSN to Mesrop Send a message via Yahoo to Mesrop Send a message via Skype™ to Mesrop
Ответ: mysql_num_rows() Problem

Огромное спасибо!
Mesrop is offline   Reply With Quote Quote selected
Old Feb 1, 2006, 18:45   #10
F'(x)=g(x)
 
KarenN's Avatar
 
Join Date: Jul 2005
Location: Mi te klinem
Posts: 4,137
Rep Power: 4
Reputation: 10
Send a message via ICQ to KarenN Send a message via MSN to KarenN Send a message via Yahoo to KarenN Send a message via Skype™ to KarenN
Re: mysql_num_rows() Problem

ara mesrop du baci Problem neric urish ban chunes inch sarcum es PROLEM bar@ mech@ anpakasa
__________________
Code:
 <a href="http://vkontakte.ru/id5695043">Я в контакте</a>
KarenN is offline   Reply With Quote Quote selected
Old Feb 2, 2006, 04:26   #11
Борец с бояном
 
Sauron's Avatar
 
Join Date: Jun 2003
Location: Yerevan
Posts: 21,440
Rep Power: 10
Reputation: 46
Re: Ответ: mysql_num_rows() Problem

Quote:
Originally Posted by mesrop
Огромное спасибо!
Да незачто
Sauron is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySql problem poet Web Development 10 Dec 18, 2005 09:00
Dial-up yahoo-mail access problem Tropical General 1 Nov 12, 2005 21:22
PHP 4.4.0 Problem... Mesrop Languages, Compilers and Interpreters 24 Nov 9, 2005 09:37
utf-8 problem Michael Web Development 4 Oct 25, 2005 09:28
Win2003 Server Problem Aram Ghazanchyan Operating Systems 7 Oct 25, 2005 04:45


All times are GMT. The time now is 07:45.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link