[PHP-DB] Re: [PHP] number of files in a dir vs. performace

2002-07-22 Thread Miguel Cruz

On Mon, 22 Jul 2002, eat pasta type fasta wrote:
> currently I am holding all of the files in 1 directory since the DB can 
> keep track of them, however their number has grown to over 400 at this 
> point
> 
> my issue is whether it would be worth it (performance wise) to split them 
> into thumbs and works thus having 200+ files per directory as opposed to 
> so many, I am expecting the number of images to double in the future.

400 is not very many. Tens of thousands can start to become a problem.

Look at the distribution of your file names and come up with a hashing 
mechanism. For instance, if your filenames are numbers, create 
subdirectories 0/ 1/ 2/ 3/ 4/ etc., and place the files based on their 
final digit.

miguel


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




[PHP-DB] Re: [PHP] another problem

2002-07-22 Thread Justin French

I would have started with a search on php.net for "hex" which would have
showed you two functions, and numerous other links that i'm not going to
read.

dechex() and hexdec() seem to do it for numbers, and i'm sure you'll find
what you need with some more looking.


Justin French


on 23/07/02 6:02 PM, Georgie Casey ([EMAIL PROTECTED]) wrote:

> well, i solved the last problem on my own but now i need help on my new one
> :-)
> 
> how do you convert text to hexadecimal with PHP?
> 
> --
> Regards,
> Georgie Casey
> [EMAIL PROTECTED]
> 
> ***
> http://www.filmfind.tv
> Online Film Production Directory
> ***
> 
> 


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




[PHP-DB] Re: HTML button display problem

2002-07-22 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Thanks for the reply.  When I added:
> 
>  
>  
> 
> 
> echo mysql_errno() . ": " . mysql_error() . "\n";?>
> 
>   
>  
> 
> 
> 
> 
> It returned the value 0:, which to me is saying that its not pulling back
> the data, but I'm not sure why.  The data in the PAYPAL_BUTTON field is:
> 
> 
> 
> 
> 
> I will paste the entirety of my code for your reference.  I'm stumped.
> Thanks again.
> 
> Mark

 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Problem with Not displaying HTML if data not found

2002-07-22 Thread markbm

When I added this code, and removed all the images from the database...that
I wanted to check to see if their  would display...it worked correctly
(but the same thing had been happening while using the other 5 methods).
When I then added back all of the images that I wanted to display.the
page did not show thembasically, it displayed the same exact page as
before and did not seem to notice that there were now images that should be
shown.  I did do a commit on the database before testing.

Thanks for your help.

Mark

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tuesday 23 July 2002 11:58, markbm wrote:
> > I am trying to develop a page that, in certain places, I only want it to
> > display the  and s if data is found for a given field.  For
> > example, if I only have an image for the  first floorplan of a house, I
do
> > NOT have an image for the  second floorplan of a house, then show the
first
> > floorplan image only.skip over that next row because the field in
the
> > db is empty.
> >
> > The problem that I'm having is that the syntax that I've been using to
> > define "empty" in the db field does not always work.  The code reads:
> >
> > if ($result[FLRPLAN_2]<>" ")  {
>
> Try:
>
>   if (!empty($result['FLRPLAN_2']))  {
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
>
> /*
> Reading is to the mind what exercise is to the body.
> */
>



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




Re: [PHP-DB] Problem with Not displaying HTML if data not found

2002-07-22 Thread Jason Wong

On Tuesday 23 July 2002 11:58, markbm wrote:
> I am trying to develop a page that, in certain places, I only want it to
> display the  and s if data is found for a given field.  For
> example, if I only have an image for the  first floorplan of a house, I do
> NOT have an image for the  second floorplan of a house, then show the first
> floorplan image only.skip over that next row because the field in the
> db is empty.
>
> The problem that I'm having is that the syntax that I've been using to
> define "empty" in the db field does not always work.  The code reads:
>
> if ($result[FLRPLAN_2]<>" ")  {

Try:

  if (!empty($result['FLRPLAN_2']))  {


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Reading is to the mind what exercise is to the body.
*/


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




[PHP-DB] Problem with Not displaying HTML if data not found

2002-07-22 Thread markbm

I am trying to develop a page that, in certain places, I only want it to
display the  and s if data is found for a given field.  For example,
if I only have an image for the  first floorplan of a house, I do NOT have
an image for the  second floorplan of a house, then show the first floorplan
image only.skip over that next row because the field in the db is empty.

The problem that I'm having is that the syntax that I've been using to
define "empty" in the db field does not always work.  The code reads:

if ($result[FLRPLAN_2]<>" ")  {
   printf ("");
 printf ("");
 printf (" Second Floor Plan:
")  ;

  printf ("") ;
 printf ("");
 printf ("") ;
 echo "'";
 printf (" ") ;
  printf (" ");
};



if ($result[FLRPLAN_3]<>" ")  {;
  printf ("");
printf ("
Third Floor Plan: ");
printf ("   ");
 printf ("  ");
 printf ("   ");
printf ("");
  echo "'";
printf ("  ");
 printf ("  ");
 };


I have tried:

1.  if ($result[FLRPLAN_3]<>" ")  {;
2.  if ($result[FLRPLAN_3]<>"")  {;
3.  if ($result[FLRPLAN_3]<>'')  {;
4.  if ($result[FLRPLAN_3]<>' ')  {;
5.  if ($result[FLRPLAN_3]<>NULL)  {;

and none seem to work correctly (i.e. blank field in db, but HTML row shows
up with missing image..or image is in db, but no HTML row shows up.  If
it helps, each of the "image" fields are varchar(125)basically I just
have the name of the image file, and then a pointer to the web server
directory structure

Any ideas would be greatly appreciated.  Thanks.

Mark



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




[PHP-DB] Re: HTML button display problem

2002-07-22 Thread markbm

Thanks for the reply.  When I added:

 
 


 

  
 




It returned the value 0:, which to me is saying that its not pulling back
the data, but I'm not sure why.  The data in the PAYPAL_BUTTON field is:





I will paste the entirety of my code for your reference.  I'm stumped.
Thanks again.

Mark

CODE:
=




<>













  

  

  


  
  
  Plan ID: %s\n",
mysql_result($result,0,"HPG_PLAN_ID"));
  ?>
   


 

 " ")  {;
  printf ("");
  printf ("Plan Name:  
%s\n", mysql_result($result,0,"PLAN_NAME"));
  printf ("");
  printf ("");
};
 ?>

Plan Description:  
%s\n", mysql_result($result,0,"PLAN_DESCRIPTION")); ?>




  Heated Sq. Ft:  
%s\n", mysql_result($result,0,"HEAT_SQ_FT"));   ?>
 
 Exterior:   %s\n",
mysql_result($result,0,"EXTERIOR")); ?>
 
 Number of Bedrooms:  
%s\n", mysql_result($result,0,"NUM_BEDROOMS")); ?>
 


  Un-Heated Sq. Ft:  
%s\n", mysql_result($result,0,"UNHEAT_SQ_FT")); ?>
 
 Foundation Type(s):  
%s\n", mysql_result($result,0,"FOUNDATION"));  ?>
 
 Number of Baths:  
%s\n", mysql_result($result,0,"NUM_BATHS"));  ?>
 

 
  Total Sq. Ft:  
%s\n", mysql_result($result,0,"TOTAL_SQ_FT")); ?>
 
 Number of Floors:  
%s\n", mysql_result($result,0,"NUM_FLOORS"));   ?>
 
 Roof Type(s):  
%s\n", mysql_result($result,0,"ROOF_TYPE"));   ?>
 


  Bonus Room:  
%s\n", mysql_result($result,0,"BONUS_ROOM"));  ?>
 
 Garage:   %s\n",
mysql_result($result,0,"GARAGE"));  ?>
 
 Number of Cars:  
%s\n", mysql_result($result,0,"NUM_CARS"));  ?>
 

 
 Roof Pitch:   %s\n",
mysql_result($result,0,"ROOF_PITCH")); ?>
 
 Width:   %s\n",
mysql_result($result,0,"WIDTH"));?>
 
 Depth:   %s\n",
mysql_result($result,0,"DEPTH"));   ?>
 


 Sec. Roof Pitch:  
%s\n", mysql_result($result,0,"SEC_ROOF_PITCH"));  ?>
 
 Main Ceiling Height:  
%s\n", mysql_result($result,0,"MAIN_CEIL_HEIGHT"));  ?>
 
  
 
 

 
 


 

  
 




 Optional
Products / Services:
 

 
 Materials List
Available:   %s\n", mysql_result($result,0,"MAT_LIST"));
?>
 
 Reproducible Sets
Available:  %s\n",
mysql_result($result,0,"REPRODUCIBLE")); ?>
 
 Color Rendering
Available:   %s\n", mysql_result($result,0,"COLOR_REND"));
?>
 


 Right-Reading Reverse Floorplan
Available:   %s\n", mysql_result($result,0,"RR_REVERSE"));
?>
 
 Mirror Reverse Floorplan
Available:   %s\n", mysql_result($result,0,"MIRROR_REV"));
?>
 
 CAD Files Available:  
%s\n", mysql_result($result,0,"CAD_FILES")); ?>
 


  
 



  Front
Elevation:
  


 
http://www.website.com/index_files/main_files/$planid/"; .
mysql_result($result, 0,'FRONT_REND')."'>'";  ?>
 



  First Floor
Plan:
 


 
http://www.website.com/index_files/main_files/$planid/"; .
mysql_result($result, 0,'FLRPLAN_1')."'>'";  ?>
 



" ")  {
   printf ("");
 printf ("");
 printf (" Second Floor Plan:
")  ;

  printf ("") ;
 printf ("");
 printf ("") ;
 echo "'";
 printf (" ") ;
  printf (" ");
};



if ($result[FLRPLAN_3]<>" ")  {;
  printf ("");
printf ("
Third Floor Plan: ");
printf ("   ");
 printf ("  ");
   

[PHP-DB] number of files in a dir vs. performace

2002-07-22 Thread eat pasta type fasta

I'm using mysql to hold references to image files then served on my pages 
via PHP.

I have typically a set of two files:

thumb and a large original, on occasion there is also a variant inreasing 
the set to 3 per image

currently I am holding all of the files in 1 directory since the DB can 
keep track of them, however their number has grown to over 400 at this 
point

my issue is whether it would be worth it (performance wise) to split them 
into thumbs and works thus having 200+ files per directory as opposed to 
so many, I am expecting the number of images to double in the future.

R>

--__-__-__
eat pasta
type fasta


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




[PHP-DB] Re: another problem

2002-07-22 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> well, i solved the last problem on my own but now i need help on my new one
> :-)
> 
> how do you convert text to hexadecimal with PHP?
> 
> --
> Regards,
> Georgie Casey
> [EMAIL PROTECTED]

If you are asking what I think you are asking - use ord to get the ascii 
(decimal) value of each character, then use dechex to convert to hex.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] Re: HTML button display problem

2002-07-22 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> It doesn't bring back any HTML when I view the source:
> 
> 
>  
> 
> 
>
>   
>  
> 
> I tried the addslashes and stripslashes but I'm not sure that I had the
> syntax right.  Any ideas?  Thanks.
> 
> Mark
> 
> "Dasmeet Singh" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > Markbm wrote:
> > > I am working through an issue where I'm trying to display HTML code,
> stored
> > > in a text field in a MySQL database.  The code that I have looks like
> this:
> > >
> > >  
> > >  
> > >
> > >  
> > > 
> > >
> > > This code displays nothing when viewed on the web server, although the
> > > contents of the db field are:
> > >
> > > 
> > > 
> > > 
> > >
> > > Question:
> > >
> > > 1.  How do I get this code to display correctly (i.e. create the button
> /
> > > not show the underlying HTML)?
> > >
> > > Any help would be greatly appreciated.  Thanks for your help.
> > >
> > > Mark
> > >
> > >
> > >
> >
> > Can you tell what HTML do you get from web server..ie when you view

Check that your mysql query is working correctly and actually returning 
data - mysql_error is a useful debugging tool. If all else fails, try 
showing the code you are using to retrieve from the db.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] another problem

2002-07-22 Thread Georgie Casey

well, i solved the last problem on my own but now i need help on my new one
:-)

how do you convert text to hexadecimal with PHP?

--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



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




[PHP-DB] libphp4.so, Sun Solaris 8, relocation error

2002-07-22 Thread Thomas Langås

OS:
Sun Solaris 8

Problem:
dilbert:/local/apache# bin/httpd  
Syntax error on line 244 of /local/apache/conf/httpd.conf:
Cannot load /local/apache/libexec/libphp4.so into server: ld.so.1: bin/httpd: fatal: 
relocation error: file 
/local/apache/libexec/libphp4.so: symbol __floatdidf: referenced symbol not found

Output from ldd:
dilbert:/usr/src/web/php-4.2.2# ldd -d  /local/apache/libexec/libphp4.so 
libdl.so.1 =>/lib/libdl.so.1
libpam.so.1 =>   /lib/libpam.so.1
libxmlrpc.so.0 =>/local/lib/libxmlrpc.so.0
libexpat.so.0 => /local/lib/libexpat.so.0
libpdf.so.1 =>   /local/lib/libpdf.so.1
libz.so.1 => /lib/libz.so.1
libsched.so.1 => /lib/libsched.so.1
libgen.so.1 =>   /lib/libgen.so.1
libsocket.so.1 =>/lib/libsocket.so.1
libnsl.so.1 =>   /lib/libnsl.so.1
libmysqlclient.so.10 =>  /local/lib/mysql/libmysqlclient.so.10
libldap.so.2 =>  /local/lib/libldap.so.2
liblber.so.2 =>  /local/lib/liblber.so.2
libintl.so.1 =>  /lib/libintl.so.1
libt1.so.1 =>/local/lib/libt1.so.1
libm.so.1 => /lib/libm.so.1
libxml2.so.2 =>  /local/lib/libxml2.so.2
libgdbm.so.2 =>  /local/lib/libgdbm.so.2
libcrypt_i.so.1 =>   /lib/libcrypt_i.so.1
libresolv.so.2 =>/lib/libresolv.so.2
libclntsh.so.8.0 =>  /local/oracle/lib/libclntsh.so.8.0
libc.so.1 => /lib/libc.so.1
libmp.so.2 =>/lib/libmp.so.2
libwtc8.so =>/local/oracle/lib/libwtc8.so
libaio.so.1 =>   /lib/libaio.so.1
/usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1
symbol not found: __floatdidf   (/local/apache/libexec/libphp4.so)
symbol not found: ap_block_alarms   
(/local/apache/libexec/libphp4.so)
symbol not found: ap_unblock_alarms 
(/local/apache/libexec/libphp4.so)
symbol not found: ap_user_name  (/local/apache/libexec/libphp4.so)
symbol not found: ap_max_requests_per_child 
(/local/apache/libexec/libphp4.so)
symbol not found: ap_server_root
(/local/apache/libexec/libphp4.so)
symbol not found: ap_user_id(/local/apache/libexec/libphp4.so)
symbol not found: ap_group_id   (/local/apache/libexec/libphp4.so)
symbol not found: top_module(/local/apache/libexec/libphp4.so)


Output from crle:
dilbert:/usr/src/web/php-4.2.2# crle

Configuration file [3]: /var/ld/ld.config  
  Default Library Path (ELF):   
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib
  Trusted Directories (ELF):
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib

Command line:
  crle -c /var/ld/ld.config -l 
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib -s 
/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib


Configure-line used:
./configure --with-mysql=/local --with-oracle=/local/oracle --with-ldap=/local 
--with-gd=/local --with-zlib 
--with-exec-dir=/local/bin --with-versioning --with-gdbm=/local --with-mod_charset 
--with-dbase --with-filepro 
--with-xml=/local --with-ttf --with-t1lib=/local --without-snmp --enable-calendar 
--enable-pic --enable-inline-optimization 
--enable-magic-quotes --enable-track-vars --enable-safe-mode --enable-sysvsem 
--enable-sysvshm --enable-trans-sid --enable-yp 
--enable-ftp --with-apxs=/local/apache/bin/apxs --enable-static --with-sablot=/local 
--with-config-file-path=/local/apache/conf/php4 --with-pdflib=shared --enable-bcmath 
--with-sysvsem --with-iconv 
--with-gettext --enable-shared --with-xslt=sablot --with-curl=/local 
--with-xmlrpc=/local --with-dom=/local 
--enable-xlst=/local --with-openssl=/local --prefix=/local --with-pdflib=/local 
--with-expat-dir=/local --enable-sigchild

A few environment vars:
LD_LIBRARY_PATH=/local/lib:/lib:/usr/lib:/store/lib:/local/oracle_client/lib:/local/oracle/lib
PATH=/bin:/usr/bin:/usr/ucb:/usr/bin/X11:/usr/local/bin:/store/bin:/usr/ccs/bin:/sbin:/usr/sbin

Anyone around with a possible solution, or does anyone
need more info to help solve the problem?  I would be
happy to provide more info, and I would be very
gratefull for a solution to this problem.


-- 
Thomas

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




[PHP-DB] Re: Not sure what I am doing wrong here?

2002-07-22 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Ok, now I am not sure why I cannot get this output into a variable so I can
> place it into a database table field.  Any help would be greatly
> appreciated.
>  
> /* Check client info and register */
> if (getenv(HTTP_X_FORWARDED_FOR)){
>  $ipaddy = getenv(HTTP_X_FORWARDED_FOR);
> } else {
>  $ipaddy = getenv(REMOTE_ADDR);
>  $host = gethostbyaddr($REMOTE_ADDR); }
> 
> /* Start looking up users IP vs. WHOIS database for logging */
> $nipaddy = "";
> function message($msg){
> echo "$msg";
> flush();
> }
> function arin($ipaddy){
> $server = "whois.arin.net";
> if (!$ipaddy = gethostbyname($ipaddy))
>   $msg .= "Can't IP Whois without an IP address.";
> else{
>   if (! $sock = fsockopen($server, 43, &$num, &$error, 20)){
> unset($sock);
> $msg .= "Timed-out connecting to $server (port 43)";
> }
>   else{
> fputs($sock, "$ipaddy\n");
> while (!feof($sock))
>   $buffer .= fgets($sock, 10240);
> fclose($sock);
> }
>if (eregi("RIPE.NET", $buffer))
>  $nextServer = "whois.ripe.net";
>else if (eregi("whois.apnic.net", $buffer))
>  $nextServer = "whois.apnic.net";
>else if (eregi("nic.ad.jp", $buffer)){
>  $nextServer = "whois.nic.ad.jp";
>  #/e suppresses Japanese character output from JPNIC
>  $extra = "/e";
>  }
>else if (eregi("whois.registro.br", $buffer))
>  $nextServer = "whois.registro.br";
>if($nextServer){
>  $buffer = "";
>  message("Deferred to specific whois server: $nextServer...");
>  if(! $sock = fsockopen($nextServer, 43, &$num, &$error, 10)){
>unset($sock);
>$msg .= "Timed-out connecting to $nextServer (port 43)";

Hmm, seems your message is too long for my newsreader to include the lot. 
However, it seems that you may not be returning a value from the function 
arin(), so whan you do 

/* Place results into a var */
$whois = arin($ipaddy); // Right now if this is here it will show in two
areas of the screen

natuarally nothing is placed in $whois.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] Re: HTML button display problem

2002-07-22 Thread markbm

It doesn't bring back any HTML when I view the source:


 


   
  
 

I tried the addslashes and stripslashes but I'm not sure that I had the
syntax right.  Any ideas?  Thanks.

Mark

"Dasmeet Singh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Markbm wrote:
> > I am working through an issue where I'm trying to display HTML code,
stored
> > in a text field in a MySQL database.  The code that I have looks like
this:
> >
> >  
> >  
> >
> >  
> > 
> >
> > This code displays nothing when viewed on the web server, although the
> > contents of the db field are:
> >
> > 
> > 
> > 
> >
> > Question:
> >
> > 1.  How do I get this code to display correctly (i.e. create the button
/
> > not show the underlying HTML)?
> >
> > Any help would be greatly appreciated.  Thanks for your help.
> >
> > Mark
> >
> >
> >
>
> Can you tell what HTML do you get from web server..ie when you view
> source for your page?
> And probably there could be problem with "quotes". Try addslashes() and
> stripslashes().
>
> --
>
>
>
> ---
> http://hp.fedoxpress.com
> Get your own 'FREE VIRTUAL POST OFFICE'
>



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




[PHP-DB] Not sure what I am doing wrong here?

2002-07-22 Thread Jas

Ok, now I am not sure why I cannot get this output into a variable so I can
place it into a database table field.  Any help would be greatly
appreciated.
");
 if(! $sock = fsockopen($nextServer, 43, &$num, &$error, 10)){
   unset($sock);
   $msg .= "Timed-out connecting to $nextServer (port 43)";
   }
 else{
   fputs($sock, "$ipaddy$extra\n");
   while (!feof($sock))
 $buffer .= fgets($sock, 10240);
   fclose($sock);
   }
 }
  $buffer = str_replace(" ", " ", $buffer);
  $msg .= nl2br($buffer);
  }
message($msg);
}
/* Place results into a var */
$whois = arin($ipaddy); // Right now if this is here it will show in two
areas of the screen

/* Start putting the data into the database table */
$table = "sessions";
 $sql_insert = "INSERT INTO $table (ipaddy,whois) VALUES
('$ipaddy','$whois')";
 $result = @mysql_query($sql_insert,$dbh) or die(MYSQL_ERROR()); // No error
but what gets entered for the var $whois is arin(66.56.34.32)
?>

 // These results should be placed in $whois
which is empty
 // This returns arin(65.44.33.23) which is wrong
Any help on this would be appreciated!
Jas



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




[PHP-DB] Re: Which community is better?

2002-07-22 Thread Nuttzy

On the main page there is a notice stating that the demo is not working.
Not sure why.  You may just want to download and experiment with it.
Especially if you have a mysql DB, the installation is automated an
painless.  Plus it's free ;-)

-Nuttzy

"Dasmeet Singh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
>
> Sir,
> Thanx for PHPBB info.. To be true.. i find the phpBB's website amongst
> the best i have ever seen (that cute huts are really attractive). But i
> am unable to test the demo...It says
> Critical error...couldnt connect to database.
> Hope you will check that out.
> Dasmeet
>
> Nuttzy wrote:
> > I'm on the Mod Development Team for phpBB, so I'm clearly biased.  I
LOVE
> > phpBB and find it meets all my needs.  In my opinion, it is clearly the
best
> > of the free boards out there.  I would also say that is the best board
> > period, free or otherwise, but the vBulletin fans make a good case.
> > vBulletin does have a few more features, but I like the tight
integration,
> > layout, and intuitiveness of phpBB.  Furthermore, the development of
phpBB
> > is ongoing and there are many folks pitching in for this open source
> > project.  By the time of their next major version release, I think it
will
> > equal or surpass vBulletin in all aspects.
> >
> > Let me know if you have any questions.  Or you can visit the phpBB
community
> > forums at http://www.phpBB.com/community
> >
> > Good Luck!
> > -Nuttzy
> >
> >
> > "Dasmeet Singh" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]...
> >
> >>I wish to implement a discussion forum for an educational site. I have
> >>heard of several PHP/MySQL ones available like postnuke, PHPBB,
> >>NeoPlanet etc.
> >>Which one is best and shall be good for educational site.
> >>Thx in advance.
> >>Dasmeet
> >>
> >>
> >>
> >>
> >>---
> >>Watch Indian TV Schedules Online @ http://www.einfotimes.com
> >>Earn Money to Read Emails (NOT SPAM) @ http://hp.fedoxpress.com
> >>
> >
> >
> >
>
>
>
> --
>
>
>
> ---
> Watch Indian TV Schedules Online @ http://www.einfotimes.com
> Earn Money to Read Emails (NOT SPAM) @ http://hp.fedoxpress.com
>



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




Re: [PHP-DB] PHP4 Not Seeing PostgreSQL 7.2

2002-07-22 Thread Jason Wong

On Monday 22 July 2002 20:49, Eric wrote:

> I completely understand what you are saying, thanks for the reply.
>
> Here is what happen. We, first couldn't connect so someone asked if phpinfo
> showed PSQL in the output and it did not.

[snip]

> Now, I assume PHPINFO is simply verifying the PGSQL connection by trying to
> connect to it under the Apache account name?

AFAIK phpinfo does nothing of the sort. It only shows the modules and options 
that PHP was compiled with. It does not attempt to connect with the pgsql 
server or mysql server or whatever.

> The problem I have with all this, as a newbie and a long time C/C++ guy, is
> that you have no idea where the problem lies. It would be better if PHPINFO
> would at least show PGSQL is part of the environment but that it simply
> couldn't connect, eh?  Maybe there is a way and I am just not seeing it
> right now?

My guess is that you didn't restart apache.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
I know not with what weapons World War III will be fought, but World
War IV will be fought with sticks and stones.
-- Albert Einstein
*/


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




Re: [PHP-DB] [PHP] pg_connect() unable to connect to PostgreSQLserver :could not connect to server

2002-07-22 Thread Devrim GUNDUZ



On Mon, 22 Jul 2002, Eric wrote:

> I agree, Unix domain sockets very much faster.
> 
> You have to start POSTMASTER with the -i switch to get it to listen on the
> designated port (5432 by default I think).

If you'll use Unix domain sockets, then do not use -i parameter. 

:) 

Best regards.

-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-



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




Re: [PHP-DB] [PHP] pg_connect() unable to connect to PostgreSQL server :could not connect to server

2002-07-22 Thread Eric

I agree, Unix domain sockets very much faster.

You have to start POSTMASTER with the -i switch to get it to listen on the
designated port (5432 by default I think).

Eric
"Devrim Gunduz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi,
>
> On Mon, 22 Jul 2002, Vincent wrote:
>
> > "Warning: pg_connect() unable to connect to PostgreSQL
> > server: could not connect to server: Connection
> > refused Is the server running on host localhost and
> > accepting TCP/IP connections on port 5432? in
> > /usr/local/apache/htdocs/postgresql.php on line 8"
> >  Unable to connect to database
>
> Please avoid using host=localhost in pg_connect parameters.
>
> As far as I guess, you have not activated the TCP-IP port in
> postgresql.conf, and if you use host=localhost parameter, pg_connect will
> try to connect to PostgreSQL via TCP-IP. If you do not use that parameter,
> then it will connect to the database via Unix domain sockets, which is
> really faster than TCP-IP sockets (and more secure).
>
> HTH.
>
> Best regards.
>
>  --
>
> Devrim GUNDUZ
>
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> Web : http://devrim.oper.metu.edu.tr
> -
>
>
>
>
>



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




Re: [PHP-DB] PHP4 Not Seeing PostgreSQL 7.2

2002-07-22 Thread Eric

I completely understand what you are saying, thanks for the reply.

Here is what happen. We, first couldn't connect so someone asked if phpinfo
showed PSQL in the output and it did not.

This lead us to believe we had a compilation problem with PHP, Apache or
Postgres. So we stopped looking for problems in our php code and began
looking for problems in the way it was compiled our tools.

There are many references to pgsql.so and we could not get this shared
object to get created. We have pgsql.o however. Thus, we started renaming
the file and copying it to different strategic directories to try to get
PGSQL to show up in phpinfo.

Now, I assume PHPINFO is simply verifying the PGSQL connection by trying to
connect to it under the Apache account name?

The problem I have with all this, as a newbie and a long time C/C++ guy, is
that you have no idea where the problem lies. It would be better if PHPINFO
would at least show PGSQL is part of the environment but that it simply
couldn't connect, eh?  Maybe there is a way and I am just not seeing it
right now?

I am just getting my feet wet with PHP so I don't know how PHP libraries or
includes work yet. I chalk this up to the fact I am still GREEN in this
area. Under C/C++, DLLS always expose their inards regardless.

Thanks

Eric

"Devrim Gunduz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Sun, 21 Jul 2002, Eric wrote:
>
> >
> > Our Apache web server runs under a unix account (of course).
> >
> > In the PostgreSQL world, you have to create a database user under the
> > same name like so:
> >
> > ./createuser webserver
> >
> > Once we did this -- everything worked.
> >
> > What puzzles me though is that PHPINFO() doesn't even show that pgsql is
> > compiled in when apparently it was there all along.
>
>
> Well, you are wrong... You do not need to use the same username of you web
> server...
>
> I mean, if you do NOT add a username parameter in your connection
> definition, then will use the username that you are running on.
>
> Let me explain like this:
>
> - If you connect via PHP and write
> pg_connect ("dbname=mydb"); --> PHP will think that you want to connect
> with the username that apache runs (maybe nobody, maybe another user)
>
> - If you connect via psql and write
> [devrim@oper devrim]$ psql mydb --> Then psql will assume that the
> username that it will use while connecting to PostgreSQL is "devrim".
>
> So, use postgres user for your connections... Or use another username and
> grant access to that user.
>
> Best regards.
>
> --
>
> Devrim GUNDUZ
>
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> Web : http://devrim.oper.metu.edu.tr
> -
>
>
>
>
>
>



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




[PHP-DB] Re: php and javascript?

2002-07-22 Thread Adam Royle

Just reiterating over what the others have said (plus expanding), and 
just a bit cleaner.









HTH,
Adam.

> Hi,
>
> Here is what I wanted to achieve, I want to get a confirmation box pop 
> up
> when user click on the delete link of the webpage(displays the contents 
> got
> from mysql database). I know we can do it in javascript easily, but my
> question is:
> 1st,
> a common javascript confirmation will be like this:
> 
> 
> 
> New Page
>
> my question is how to integrate the javascript with php, the sample 
> delete
> link will be something like: http://localhost/index.php?id=1 ,and the id
> number(in this case:1) is from database: ( href=delete.php?".$row["id"].">)
>
> 2nd is there a better way to write pure php code to get a confirm 
> window pop
> up once i clicked on delete link?
>
> Thanks and Good day.
>
> Bo



Re: [PHP-DB] PHP4 Not Seeing PostgreSQL 7.2

2002-07-22 Thread Devrim GUNDUZ


On Sun, 21 Jul 2002, Eric wrote:

>
> Our Apache web server runs under a unix account (of course).
>
> In the PostgreSQL world, you have to create a database user under the 
> same name like so:
>
> ./createuser webserver
>
> Once we did this -- everything worked.
>
> What puzzles me though is that PHPINFO() doesn't even show that pgsql is
> compiled in when apparently it was there all along.


Well, you are wrong... You do not need to use the same username of you web 
server...

I mean, if you do NOT add a username parameter in your connection 
definition, then will use the username that you are running on.

Let me explain like this:

- If you connect via PHP and write
pg_connect ("dbname=mydb"); --> PHP will think that you want to connect 
with the username that apache runs (maybe nobody, maybe another user)

- If you connect via psql and write
[devrim@oper devrim]$ psql mydb --> Then psql will assume that the 
username that it will use while connecting to PostgreSQL is "devrim".

So, use postgres user for your connections... Or use another username and 
grant access to that user.

Best regards.

-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-







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




[PHP-DB] Good table structure for search

2002-07-22 Thread JJ Harrison

To add search functionality I decieded this was the best table structure I
could come up with for a  keywords table.

Here it is:

CREATE TABLE article_keyword (
  aid int(11) unsigned NOT NULL default '0',
  keyword char(50) NOT NULL default '',
  weight tinyint(2) unsigned NOT NULL default '0',
  PRIMARY KEY  (aid),
  KEY keyword (keyword),
  KEY aid (aid),
  KEY weight (weight)
) TYPE=MyISAM;

Using that structure could I get a decent search?

I would probably add up the weight for each keyword(Where it is searched
for). Then sort it by the most 'relevent' then I could use a join to get the
title, time etc of the article and return the results.

What I am asking is that if this is a good table structure for something
like this(N00B alert!). If not could you please give me a better one?


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com





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




RE: [PHP-DB] php and javascript?

2002-07-22 Thread Tommy Claasens - Q Data KZN


Hi, 

Have a look at " 

var rVal;
window.returnValue = rVal;
rVal= showModalDialog('test.php?op=.','','');
.
.   
.


This will pop up a user defined pop-up where the user can take action based
on what you present them. 
HTH 
Tommy

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: Mon, 22 Jul 2002 09:56
To: 'bo'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] php and javascript?


Bo,
you have really answered your own question (question 1) all you need to do
is replace http://detination with http://localhost/index.php?id=1 (as per
your examples) and it should send them to the page which triggers the
deletion of the page (if they confirm the box)

as far as q2 goes, you could send them to a page where they delete
something, and then that page actually just displays a message (on the page,
rather than a pop-up) which asks if they are sure, they click yes or no and
it does the same thing as the javascript popup. there is no way to create a
popup with PHP, so if you were considering popping a window using javascript
and then writing into it with php, you may as well just do it with the
javascript confirm() (much cooler) or with pure php (much more "robust" and
reliable).

HTH

Beau

// -Original Message-
// From: bo [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 22 July 2002 3:45 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] php and javascript?
// 
// 
// Hi,
// 
// Here is what I wanted to achieve, I want to get a 
// confirmation box pop up
// when user click on the delete link of the webpage(displays 
// the contents got
// from mysql database). I know we can do it in javascript 
// easily, but my
// question is:
// 1st,
// a common javascript confirmation will be like this:
// 
// 
// 
// New Page
// 
// my question is how to integrate the javascript with php, the 
// sample delete
// link will be something like: http://localhost/index.php?id=1 
// ,and the id
// number(in this case:1) is from database: ()
// 
// 2nd is there a better way to write pure php code to get a 
// confirm window pop
// up once i clicked on delete link?
// 
// Thanks and Good day.
// 
// Bo
// 
// 
// 
// -- 
// 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] php and javascript?

2002-07-22 Thread Beau Lebens

Bo,
you have really answered your own question (question 1) all you need to do
is replace http://detination with http://localhost/index.php?id=1 (as per
your examples) and it should send them to the page which triggers the
deletion of the page (if they confirm the box)

as far as q2 goes, you could send them to a page where they delete
something, and then that page actually just displays a message (on the page,
rather than a pop-up) which asks if they are sure, they click yes or no and
it does the same thing as the javascript popup. there is no way to create a
popup with PHP, so if you were considering popping a window using javascript
and then writing into it with php, you may as well just do it with the
javascript confirm() (much cooler) or with pure php (much more "robust" and
reliable).

HTH

Beau

// -Original Message-
// From: bo [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 22 July 2002 3:45 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] php and javascript?
// 
// 
// Hi,
// 
// Here is what I wanted to achieve, I want to get a 
// confirmation box pop up
// when user click on the delete link of the webpage(displays 
// the contents got
// from mysql database). I know we can do it in javascript 
// easily, but my
// question is:
// 1st,
// a common javascript confirmation will be like this:
// 
// 
// 
// New Page
// 
// my question is how to integrate the javascript with php, the 
// sample delete
// link will be something like: http://localhost/index.php?id=1 
// ,and the id
// number(in this case:1) is from database: ()
// 
// 2nd is there a better way to write pure php code to get a 
// confirm window pop
// up once i clicked on delete link?
// 
// Thanks and Good day.
// 
// Bo
// 
// 
// 
// -- 
// 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




Re: [PHP-DB] [PHP] pg_connect() unable to connect to PostgreSQLserver :could not connect to server

2002-07-22 Thread Devrim GUNDUZ


Hi,

On Mon, 22 Jul 2002, Vincent wrote:

> "Warning: pg_connect() unable to connect to PostgreSQL
> server: could not connect to server: Connection
> refused Is the server running on host localhost and
> accepting TCP/IP connections on port 5432? in
> /usr/local/apache/htdocs/postgresql.php on line 8"
>  Unable to connect to database

Please avoid using host=localhost in pg_connect parameters.

As far as I guess, you have not activated the TCP-IP port in 
postgresql.conf, and if you use host=localhost parameter, pg_connect will 
try to connect to PostgreSQL via TCP-IP. If you do not use that parameter, 
then it will connect to the database via Unix domain sockets, which is 
really faster than TCP-IP sockets (and more secure).

HTH.

Best regards.

 -- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-






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




[PHP-DB] php and javascript?

2002-07-22 Thread bo

Hi,

Here is what I wanted to achieve, I want to get a confirmation box pop up
when user click on the delete link of the webpage(displays the contents got
from mysql database). I know we can do it in javascript easily, but my
question is:
1st,
a common javascript confirmation will be like this:



New Page

my question is how to integrate the javascript with php, the sample delete
link will be something like: http://localhost/index.php?id=1 ,and the id
number(in this case:1) is from database: ()

2nd is there a better way to write pure php code to get a confirm window pop
up once i clicked on delete link?

Thanks and Good day.

Bo



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




[PHP-DB] [PHP] pg_connect() unable to connect to PostgreSQL server :could not connect to server

2002-07-22 Thread Vincent

Hi, 
 I'm a newbie. I've set up Apache 1.3.26 and Php
4.2.1. I've looked into phpinfo(); and I can see that
pgsql is working.

But, when I run a simple php file,
"

Example PHP Querying

";
} else
print "Connected";
?>

"

I get these warnings. What should I do now? I've even
set the authorization to trust instead of ident in the
pg_hba.conf. Did I overlook something?
"Warning: pg_connect() unable to connect to PostgreSQL
server: could not connect to server: Connection
refused Is the server running on host localhost and
accepting TCP/IP connections on port 5432? in
/usr/local/apache/htdocs/postgresql.php on line 8"
 Unable to connect to database
 

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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