[PHP-DB] Photo Gallery Comments.. NOT WORKING

2003-09-25 Thread Adam Symonds
Hi I have the following code which is a photo gallery, I have set it up so
users
can add comments to the photos, what I want to happen is in the gallery if a
user
has posted a comment on the photo, I want it to say comments under the photo
in the gallery, I have tried doing this using  IN_ARRAY but I am getting an
error msg,

Warning: in_array(): Wrong datatype for second argument
on line 203

line 203 is this: if(in_array($images[$i],$result))echo brfont
class=blueComments/font;
will have a play around with a few things and left yuo know if I suceed b4
you get back.

Can someone see what I am doing wrong with the in_array..

Thanx In advance
Adam

==

?PHP
//start of comments selection...
   $mysql_access = mysql_connect(localhost, username, password) or
DIE(mysql_error());
   mysql_select_db(database, $mysql_access) or DIE(mysql_error());
$query = SELECT * FROM comphotolink WHERE comphotolink.PhotoPath =
$PathVar;
   $result = mysql_query($query, $mysql_access) or DIE(mysql_error());
if ($result) {
while ($r = mysql_fetch_array($result))
{ // Begin While
extract($r);
$PhotoName = $PhotoName;
//echo $PhotoName br;
} //End While
} else {
echo no commentsbrbr;
}

//end of comments selection

//page vars
$total = count($images);
$limit = 15;
$page = $_GET['page'];
$num_prow=3;

//$offset = ($page - 1) * $limit;

//$jpgs=0;
$handle=opendir($PathVar);
$index=0;
$images;
$last_updated;

while($file=readdir($handle)){

if($file!='.'  $file!='..'){
$myfile=explode(.,$file);

if($myfile[1]=='jpg' || $myfile[1]=='JPG'){
$images[$index]=$file;
//$size[$index]=filesize($file);
//$date[$index]=filemtime($file);
$thumb[$index]=$file;
$index++;
$jpgs++;
}
}
}

if(!$images){
print ::BWarning/b::brThis folder contains no allowed image files.;
exit;
}

$total=count($images);

$numPages = ceil($total / $limit);


$j=0;

// Set first set of pictures
if(!isset($pics)){$pics=$page * $limit;}

//$pics = $page * $limit;


$from = $pics-$limit;
$pp = $pics+$limit;
// =OUTPUT=

$query2 = SELECT * FROM eventlistings WHERE PhotoPath = $PathVar;
   $result2 = mysql_query($query2, $mysql_access) or DIE(mysql_error());
if ($result2) {
while ($r = mysql_fetch_array($result2))
{ // Begin While
extract($r);
echo ;
}} //End While

echo div align=centerstrong$EventName - $EventDate/strong br
Directory contains a total of .count($images). image files /divBR;

echo div align=centertable cellspacing=10 cellpadding=10
bordercolor=#CC33CC border=1 class=txttr bordercolor=#00
bgcolor=White;

for($i = $from; $i  $pics  $i  $total; $i++){

if($j == $num_prow){
echo 
tr bordercolor=#00 bgcolor=Whitetd align=center valign=topa
href=\MainPhoto.php?Image=$thumb[$i]PhotoPath=$PathVar\
!-- $images[$i]BRBR --
img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
if(in_array($images[$i],$result))echo brfont
class=blueComments/font;
echo /td;
//
$j = 1;

}else{
echo td align=center valign=topa
href=\MainPhoto.php?Image=$images[$i]PhotoPath=$PathVar\!--$images[$i]
BRBR --img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
//
if(in_array($images[$i],$result))echo brfont
class=blueComments/font;//

$j++;

}
}
echo /tr/tableBRBRBR;

if ($page == 1) // this is the first page - there is no previous page
echo Previous;
else// not the first page, link to the previous page
echo a href=\Gallery.php?PathVar=$PathVarpage= . ($page - 1) .
\ class=cssbtnPrevious/a;

for ($i = 1; $i = $numPages; $i++) {
echo  | ;
if ($i == $page)
echo $i;
else
echo a href=\Gallery.php?PathVar=$PathVarpage=$i\$i/a;
}

if ($page == $numPages) // this is the last page - there is no next page
echo  | Next;
else// not the last page, link to the next page
echo  | a href=\Gallery.php?PathVar=$PathVarpage= . ($page + 1)
. \ class=cssbtnNext/a;
/*
if($i  $total){echo a
href=\.$PHP_SELF.?PathVar=$PathVarpage=$pp\Next/a;}
if($page != $total){echo  a
href=\.$PHP_SELF.?PathVar=$PathVarpage=$total\Last/a/div;}
*/
echo brbr/body/html;

closedir($handle);
?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Photo Gallery Comments.. NOT WORKING

2003-09-25 Thread Viorel Dragomir
Hi,

I see that you try to use $result, which is a resource [i think], as a
normal string.
Try to use the fetch data instead of the resource.


vio-
- Original Message - 
From: Adam Symonds [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 9:14 AM
Subject: [PHP-DB] Photo Gallery Comments.. NOT WORKING


 Hi I have the following code which is a photo gallery, I have set it up so
 users
 can add comments to the photos, what I want to happen is in the gallery if
a
 user
 has posted a comment on the photo, I want it to say comments under the
photo
 in the gallery, I have tried doing this using  IN_ARRAY but I am getting
an
 error msg,

 Warning: in_array(): Wrong datatype for second argument
 on line 203

 line 203 is this: if(in_array($images[$i],$result))echo brfont
 class=blueComments/font;
 will have a play around with a few things and left yuo know if I suceed b4
 you get back.

 Can someone see what I am doing wrong with the in_array..

 Thanx In advance
 Adam

 ==

 ?PHP
 //start of comments selection...
$mysql_access = mysql_connect(localhost, username, password) or
 DIE(mysql_error());
mysql_select_db(database, $mysql_access) or DIE(mysql_error());
 $query = SELECT * FROM comphotolink WHERE comphotolink.PhotoPath =
 $PathVar;
$result = mysql_query($query, $mysql_access) or DIE(mysql_error());
 if ($result) {
 while ($r = mysql_fetch_array($result))
 { // Begin While
 extract($r);
 $PhotoName = $PhotoName;
 //echo $PhotoName br;
 } //End While
 } else {
 echo no commentsbrbr;
 }

 //end of comments selection

 //page vars
 $total = count($images);
 $limit = 15;
 $page = $_GET['page'];
 $num_prow=3;

 //$offset = ($page - 1) * $limit;

 //$jpgs=0;
 $handle=opendir($PathVar);
 $index=0;
 $images;
 $last_updated;

 while($file=readdir($handle)){

 if($file!='.'  $file!='..'){
 $myfile=explode(.,$file);

 if($myfile[1]=='jpg' || $myfile[1]=='JPG'){
 $images[$index]=$file;
 //$size[$index]=filesize($file);
 //$date[$index]=filemtime($file);
 $thumb[$index]=$file;
 $index++;
 $jpgs++;
 }
 }
 }

 if(!$images){
 print ::BWarning/b::brThis folder contains no allowed image
files.;
 exit;
 }

 $total=count($images);

 $numPages = ceil($total / $limit);


 $j=0;

 // Set first set of pictures
 if(!isset($pics)){$pics=$page * $limit;}

 //$pics = $page * $limit;


 $from = $pics-$limit;
 $pp = $pics+$limit;
 // =OUTPUT=

 $query2 = SELECT * FROM eventlistings WHERE PhotoPath = $PathVar;
$result2 = mysql_query($query2, $mysql_access) or DIE(mysql_error());
 if ($result2) {
 while ($r = mysql_fetch_array($result2))
 { // Begin While
 extract($r);
 echo ;
 }} //End While

 echo div align=centerstrong$EventName - $EventDate/strong br
 Directory contains a total of .count($images). image files /divBR;

 echo div align=centertable cellspacing=10 cellpadding=10
 bordercolor=#CC33CC border=1 class=txttr bordercolor=#00
 bgcolor=White;

 for($i = $from; $i  $pics  $i  $total; $i++){

 if($j == $num_prow){
 echo 
 tr bordercolor=#00 bgcolor=Whitetd align=center valign=topa
 href=\MainPhoto.php?Image=$thumb[$i]PhotoPath=$PathVar\
 !-- $images[$i]BRBR --
 img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
 if(in_array($images[$i],$result))echo brfont
 class=blueComments/font;
 echo /td;
 //
 $j = 1;

 }else{
 echo td align=center valign=topa

href=\MainPhoto.php?Image=$images[$i]PhotoPath=$PathVar\!--$images[$i]
 BRBR --img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
 //
 if(in_array($images[$i],$result))echo brfont
 class=blueComments/font;//

 $j++;

 }
 }
 echo /tr/tableBRBRBR;

 if ($page == 1) // this is the first page - there is no previous page
 echo Previous;
 else// not the first page, link to the previous page
 echo a href=\Gallery.php?PathVar=$PathVarpage= . ($page - 1)
.
 \ class=cssbtnPrevious/a;

 for ($i = 1; $i = $numPages; $i++) {
 echo  | ;
 if ($i == $page)
 echo $i;
 else
 echo a
href=\Gallery.php?PathVar=$PathVarpage=$i\$i/a;
 }

 if ($page == $numPages) // this is the last page - there is no next
page
 echo  | Next;
 else// not the last page, link to the next page
 echo  | a href=\Gallery.php?PathVar=$PathVarpage= . ($page +
1)
 . \ class=cssbtnNext/a;
 /*
 if($i  $total){echo a
 href=\.$PHP_SELF.?PathVar=$PathVarpage=$pp\Next/a;}
 if($page != $total){echo  a
 href=\.$PHP_SELF.?PathVar=$PathVarpage=$total\Last/a/div;}
 */
 echo brbr/body/html;

 closedir($handle);
 ?

 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Email Application

2003-09-25 Thread mutie
Hey Guys,

I am not so new in PHP but I have a problem.
I am trying to create a webmail program for my penpal
site. I cant retrieve and desplay e-mails from my mail
server. Any one with ideas?

Regards,

~ Charles

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: Email Application

2003-09-25 Thread Jason Wong
On Thursday 25 September 2003 05:42, [EMAIL PROTECTED] wrote:

 I am not so new in PHP but I have a problem.
 I am trying to create a webmail program for my penpal
 site. I cant retrieve and desplay e-mails from my mail
 server. Any one with ideas?

With the limited amount of information give, I would say there is something 
wrong with your code.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Marriage is the waste-paper basket of the emotions.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: Email Application

2003-09-25 Thread Ignatius Reilly
If your mail server supports IMAP, you should use the PHP IMAP functions.
Very convenient.

Ignatius
_
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 11:42 PM
Subject: [PHP-DB] Re: Email Application


 Hey Guys,

 I am not so new in PHP but I have a problem.
 I am trying to create a webmail program for my penpal
 site. I cant retrieve and desplay e-mails from my mail
 server. Any one with ideas?

 Regards,

 ~ Charles

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] parse error.

2003-09-25 Thread Mücella Erdem Efe
I am a new programmer of PHP4.3.3 an MySql 3.23 .

When below script is executed
Parse error: parse error, unexpected T_DNUMBER in c:\program
files\apache group\apache\htdocs\ilkdeneme21.php on line 17
 is being seen.

This may be very simple but I could not solve it.Could you help me for this
error?
Thanks for your attention
[EMAIL PROTECTED]


?
$dbname = 'mycmpe';

mysql_connect(localhost,username);
if (mysql_select_db($dbname))
{ echo connected;}
else
{ echo not connected;}

$query=insert into dene (day,start_time) values (2003.09.25,22:30)  ;
   $result=mysql_query($query);
   if ($result))
{ echo data girildi;}
else
{ echo data girilemedi;
  exit;}

?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



SV: [PHP-DB] parse error.

2003-09-25 Thread Henrik Hornemann
Hi,

There are at least two errors in your script:

$query=insert into dene (day,start_time) values (2003.09.25,22:30)  ;
should be
$query=insert into dene (day,start_time) values ('2003.09.25','22:30')  ;

And
if ($result))
should be
if ($result)

regards Henrik Hornemann

 -Oprindelig meddelelse-
 Fra: Mücella Erdem Efe [mailto:[EMAIL PROTECTED]
 Sendt: 26. september 2003 00:52
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] parse error.
 
 
 I am a new programmer of PHP4.3.3 an MySql 3.23 .
 
 When below script is executed
 Parse error: parse error, unexpected T_DNUMBER in c:\program
 files\apache group\apache\htdocs\ilkdeneme21.php on line 17
  is being seen.
 
 This may be very simple but I could not solve it.Could you 
 help me for this
 error?
 Thanks for your attention
 [EMAIL PROTECTED]
 
 
 ?
 $dbname = 'mycmpe';
 
 mysql_connect(localhost,username);
 if (mysql_select_db($dbname))
 { echo connected;}
 else
 { echo not connected;}
 
 $query=insert into dene (day,start_time) values 
 (2003.09.25,22:30)  ;
$result=mysql_query($query);
if ($result))
 { echo data girildi;}
 else
 { echo data girilemedi;
   exit;}
 
 ?
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] OUTFILE

2003-09-25 Thread Jonatan Pugliese.
How to use OUTFILE function in mysql and linux?



Jonatan Pugliese
Area Sistemas
ACA - Automovil club Argentino
4808-4676 / 4663
www.aca.org.ar  

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] OUTFILE

2003-09-25 Thread Nitin
select column list into OUTFILE filename from tablename

Enjoy happy programming
Nitin


- Original Message - 
From: Jonatan Pugliese. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 6:59 PM
Subject: [PHP-DB] OUTFILE


 How to use OUTFILE function in mysql and linux?
 
 
 
 Jonatan Pugliese
 Area Sistemas
 ACA - Automovil club Argentino
 4808-4676 / 4663
 www.aca.org.ar  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Re: [PHP-DB] parse error.

2003-09-25 Thread Steve Davies
Hi Micella

You need to either slash-escape your insert query or use single quotes:

$query=insert into dene (day,start_time) values (\2003.09.25\,\22:30\)  ;

or

$query=insert into dene (day,start_time) values ('2003.09.25','22:30')  ;

steve

M|cella Erdem Efe wrote:

I am a new programmer of PHP4.3.3 an MySql 3.23 .

When below script is executed
   Parse error: parse error, unexpected T_DNUMBER in c:\program
files\apache group\apache\htdocs\ilkdeneme21.php on line 17
is being seen.
This may be very simple but I could not solve it.Could you help me for this
error?
Thanks for your attention
[EMAIL PROTECTED]
?
$dbname = 'mycmpe';
mysql_connect(localhost,username);
if (mysql_select_db($dbname))
{ echo connected;}
else
{ echo not connected;}
$query=insert into dene (day,start_time) values (2003.09.25,22:30)  ;
  $result=mysql_query($query);
  if ($result))
{ echo data girildi;}
else
{ echo data girilemedi;
 exit;}
?

 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] MySQL Very Slow Work.

2003-09-25 Thread äÒÕÞÉË ëÉÒÉÌÌ
I have php 4.3.2, Apache 2.0.46 and MySQL 4.* on Windows 2000 SP4.
And i have problem.
When i make query from php to MySQL.
This work wery slow.
Every query 4-5 sec.
What i can make.
Sorry for error, i know english wery bad.
Please HELP ME!

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL Very Slow Work.

2003-09-25 Thread George Patterson


On Sat, 20 Sep 2003 19:54:18 +0400
äÒÕÞÉË ëÉÒÉÌÌ [EMAIL PROTECTED] wrote:

 I have php 4.3.2, Apache 2.0.46 and MySQL 4.* on Windows 2000 SP4.
 And i have problem.
 When i make query from php to MySQL.
 This work wery slow.
 Every query 4-5 sec.
 What i can make.
 Sorry for error, i know english wery bad.
 Please HELP ME!
 

Don't worry about your grammar errors. I'm sure my russian would be
worse. I am assuming you that are russian based on you email
address..but that is off topic for the list.

Firstly, You never said what processor and the amount of memory that is
in the machine that you have install that software.

How many records have you got in the database?? We have implemented a
project in which queries take 20-30 seconds.. about 1 million records,
I think..


George Patterson

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Sybase

2003-09-25 Thread Stephan van Beerschoten
Hi all,

As many, I'm forced to start my message too with the problem statement
that I can't connect to my sybase database. I have to be more honest
even in saying that I don't even know the difference in --enable-sybase
and --enable-sybase-ct (I have tried both). 

I'm by no means an SQL nitwit.. I just never had to work with sybase
before.
I don't have any clue when it comes to sybase.. never worked with
any, but I have to now. I have a login and can connect using isql
and the database definition 'CST_SYB' which comes straight out of the
sybase interfaces file.
However I can't seem to get any php connections working. I can flood you
with sybase_connect() examples, but they come straight from the manual.
What am I missing ? 

Oh btw, I compiled my php using the orignal sybase openclient package in
$SYBASE, but I also see people referring to 'freedts'? I assume this is
a substitute in case no original sybase libs are available, right?
Anyway, any pointers would be more then welcome.

/Stephan

--
Stephan van Beerschoten [SVB21-RIPE]   [EMAIL PROTECTED]
 PGP fingerprint:  4557 9761 B212 FB4C  778D 3529 C42A 2D27
To err is human, to forgive is Not Company Policy
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Firebird under Windows 2000

2003-09-25 Thread thejavo
Hi!:
I don't know if anybody tried PHP with Firebird, but I've got a really
curious problem. I've installed PHP 4.3.3 and work with Firebird 1.5 RC6 and
MS - IIS without any problems, but suddenly, and with no other advice or
error messages than the ring of a bell my PHP pages stop to work. I tried
everything but nothing seems to solve the problem.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php