RE: [Linux-programlama] PHP Script Hatası

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Fatih Kaya (fkayaist@gmail.com)
Date: Thu 18 Jan 2007 - 09:24:13 GMT


Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in D:\Vhosts\falanfilan.com\httpdocs\foto.php on line 220

Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in D:\Vhosts\falanfilan.com\httpdocs\foto.php on line 221

Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in D:\Vhosts\falanfilan.com\httpdocs\foto.php on line 222

Bu şekilde bir hata alıyorum.

Bu satırlar:

220 > $kayit_foto3 = mysql_result($sql3,$i3,"foto");

221 > $kayit_baslik3 = mysql_result($sql3,$i3,"baslik");

222> $kayit_diger3 = mysql_result($sql3,$i3,"diger");
 

Fatih Kaya
-----Original Message-----
From: linux-programlama-bounces@liste.linux.org.tr
[mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of What you
get is Not what you see
Sent: Thursday, January 18, 2007 11:16 AM
To: linux-programlama@liste.linux.org.tr
Subject: Re: [Linux-programlama] PHP Script Hatası

Manualden alinti :
When working on large result sets, you should consider using one of
the functions that fetch an entire row (
mysql_fetch_row()
mysql_fetch_array()
mysql_fetch_assoc()
mysql_fetch_object()). As these functions return the contents of
multiple cells in one function call, they're MUCH quicker than
mysql_result(). Also, note that specifying a numeric offset for
the field argument is much quicker than specifying a fieldname or
tablename.fieldname argument.

Performance: An important thing to note is that using
mysql_fetch_array() is not significantly slower than using
mysql_fetch_row(), while it provides a significant added value.

Sorunuzda hatadan bahsetmissiniz. O neydi?

On 1/18/07, Fatih Kaya <fkayaist@gmail.com> wrote:
>
>
>
>
> Peki, hangisini kullanmam performans açısından daha iyidir?
>
>
>
> 1. mysql_result()
>
> 2. mysql_fetch_array
> $kayit[" foto"] şeklinde
>
> 3. mysql_fetch_object
> $kayit->foto
>
>
>
>
> Fatih Kaya
>
> ________________________________

>
> From: linux-programlama-bounces@liste.linux.org.tr
[mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of Huseyin
Gomleksizoglu
> Sent: Thursday, January 18, 2007 10:48 AM
> To: linux-programlama@liste.linux.org.tr
> Subject: Re: [Linux-programlama] PHP Script Hatası
>
>
>
>
> if($a==4) {
>
> yerine
>
> if ($i3 % 4 == 0) {
>
> gibi bir yapı kullanırsan $a diye bir değişkene ihtiyacın kalmaz.
>
> ayrıca Agah Bey'in dediği gibi mysql_fetch_array veya mysql_fetch_object
kullanabilirsiniz. Bu durumda
> mysql_result() fonksiyonunu da kullanmanıza gerek kalmaz.
>
> mysql_fetch_array kullanırsanız
> $kayit[" foto"] şeklinde
>
> mysql_fetch_object kullanırsanız
> $kayit->foto şeklinde bilgilere erişebilirsiniz.
>
> son olarak da
>
> <tr align="center">
>
> her 4 kayıtta bir </tr> yapıyorsun ama daha sonra yeni bir <tr>
açmıyorsun. Bu durumda tablon düzgün gözükmez.
>
> $a++;
>
> if($a==4) {
>
> echo("</tr>\n<tr align\"Center\">");
>
> $a=0;
>
> }
>
> şeklinde yapmalısın.
>
>
>
>
>
>
> On 1/18/07, Agah ALICI < agah@sakarya.edu.tr> wrote:
>
>
> Merhaba,
>
> while($kayit = mysql_fetch_array($sql3)){
>
> .....
>
> }
>
>
> şeklinde kullansanız daha doğru olur sanıyorum.
>
>
>
>
>
> İyi çalışmalar...
>
>
>
> ________________________________

>
> From: linux-programlama-bounces@liste.linux.org.tr
[mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of Fatih
Kaya
> Sent: Thursday, January 18, 2007 10:07 AM
> To: linux-programlama@liste.linux.org.tr
> Subject: [Linux-programlama] PHP Script Hatası
>
>
>
> Merhaba,
>
>
>
>
> Şu kodda genel bir mantık hatası, kod hatası..vb. bir hata görüyor
musunuz? Yada nasıl söylesem, bu şekilde bir sorgulama ve kayıt gosterme
yerine daha güvenli ve hatasız bir yazım şekli var mıdır? Kod normalde
çalışıyor ancak sayfa ard arda refresh edildiğinde hata veriyor.
>
>
>
> Rastgele foto gösteren script: (bir hata var mı?)
>
>
>
> <?php
>
> $sql3 = mysql_query("SELECT id, baslik, foto, diger, aciklama FROM foto
ORDER BY rand() DESC limit 16");
>
> ?>
>
> <tr align="center">
>
> <?php
>
> for($i3=0;$i3<16;$i3++){
>
> $kayit_id3 = mysql_result($sql3,$i3,"id");
>
> $kayit_foto3 = mysql_result($sql3,$i3,"foto");
>
> $kayit_baslik3 = mysql_result($sql3,$i3,"baslik");
>
> $kayit_diger3 = mysql_result($sql3,$i3,"diger");
>
> $kayit_ack3 = mysql_result($sql3,$i3,"aciklama");
>
> ?>
>
> <td width="195"><a href="foto.php?id=<?=$kayit_id3?>"><img
alt="<?=$kayit_ack3?>" src="<?=$kayit_foto3?>" width="160" height="120"
border="0" /></a><br />
>
> <br
/>
>
> <span
class="style2"><?=$kayit_diger3?></span></td>
>
> <?php
>
> $a++;
>
> if($a==4) {
>
> echo("</tr>");
>
> $a=0;
>
> }
>
> }
>
>
> ?>
>
>
>
>
> Fatih Kaya
>
>
>
>
>
> _________________________________________________________
>
> Bu E-Posta Sakarya Universitesi E-posta Sunucusu Araciligiyla Size
Ulastirilmistir.
>
> SAU >> BIDB >> Ar-Ge S.M. >> Sistem Yonetimi Servisi
>
> >> BitDefender Antivirus Yazilimi Tarafindan Virus Taramasindan
Gecirilmistir.
>
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama@liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>
>
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama@liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>
>

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.