 |
mysql_num_rows() Problem |
 |
09.12.2005, 19:53
|
#1
|
полюбому йес эм...
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
|
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....
|
|
|
 |
 |
Re: mysql_num_rows() Problem |
 |
09.12.2005, 21:14
|
#2
|
Banned
Join Date: 10 2001
Location: ...осень колибри
Age: 45
Posts: 7,487
Rep Power: 0
|
Re: mysql_num_rows() Problem
Может быть так, что запрос ничего не выдает?
Попробуй написать так
$res=mysql_query($query) or die("MySQL query '" . $query . "' failed");
|
|
|
 |
Re: mysql_num_rows() Problem |
 |
09.12.2005, 21:23
|
#3
|
Какое небо, *, Багдад!
Join Date: 10 2005
Location: Ереван
Posts: 1,682
Rep Power: 4
|
Re: mysql_num_rows() Problem
Скорее всего не та таблица и/или остальная часть запроса, вот и результат не "ресурс", а код возврата обработанного запроса.
2Forever Child: не видел поста
__________________
мордой об лавку
LISP is the only language that is truly beautiful.
d
.
Хочу трахнуть Nissan Skyline R34, и ездить на Alessandra Ambrosio
|
|
|
 |
Ответ: mysql_num_rows() Problem |
 |
10.12.2005, 10:58
|
#4
|
полюбому йес эм...
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
|
Ответ: 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." ".$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?
|
|
|
 |
 |
Ответ: mysql_num_rows() Problem |
 |
10.12.2005, 11:07
|
#5
|
полюбому йес эм...
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
|
Ответ: 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!
|
|
|
 |
Re: Ответ: mysql_num_rows() Problem |
 |
18.12.2005, 09:54
|
#6
|
Вечный Студент
Join Date: 10 2003
Location: Armenia
Age: 44
Posts: 69
Rep Power: 0
|
Re: Ответ: mysql_num_rows() Problem
Harmar e ogtagorcel:
$res=mysql_query($query) or die(mysql_error());
Miangamic erevum e zaprosi sxal'.
Udachi.
|
|
|
 |
Ответ: mysql_num_rows() Problem |
 |
01.02.2006, 09:05
|
#7
|
полюбому йес эм...
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
|
Ответ: 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
|
|
|
 |
Re: Ответ: mysql_num_rows() Problem |
 |
01.02.2006, 11:32
|
#8
|
Борец с бояном
Join Date: 06 2003
Location: Yerevan
Age: 46
Posts: 21,482
Rep Power: 9
|
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
|
|
|
 |
Ответ: mysql_num_rows() Problem |
 |
01.02.2006, 16:46
|
#9
|
полюбому йес эм...
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
|
Ответ: mysql_num_rows() Problem
 Огромное спасибо!
|
|
|
 |
Re: mysql_num_rows() Problem |
 |
01.02.2006, 19:45
|
#10
|
F'(x)=g(x)
Join Date: 07 2005
Location: Mi te klinem
Age: 34
Posts: 4,145
Rep Power: 4
|
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>
|
|
|
 |
Re: Ответ: mysql_num_rows() Problem |
 |
02.02.2006, 05:26
|
#11
|
Борец с бояном
Join Date: 06 2003
Location: Yerevan
Age: 46
Posts: 21,482
Rep Power: 9
|
Re: Ответ: mysql_num_rows() Problem
Quote:
Originally Posted by mesrop
 Огромное спасибо!
|
Да незачто
|
|
|
All times are GMT. The time now is 13:00. |
|
|