[PHP-DB] To many connections error
Hello everybody, I am running a community portal with LAMP . So far everything was running fine. This night the site went down for a few hours. The error message from mysql was to many connections. Is there a way to increase the number of allowed connections, or do I have a hardware problem here (celleron 1GHZ 256 MB ram)? The traffic for the site is rising constantly and I fear to get in trouble. Thanx for your help. Merlin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PEAR::DB question
Jake Dunno if this will help, whether you're using MySQL or whether it works in PEAR. Look up mysql_data_seek() in the php manual. Cheers Terry --Original Message- Hello- I'm using the fetch method to get a result set. ie- $sql = select id,name from sr_names order by name; $result = $db-query($sql); while ( $row = $result-fetchRow(DB_FETCHMODE_ASSOC) ) echo $row['id'] . ' ' . $row['name'] . br; This works great! Now, I want to _re-use_ this result set without having to re-query the database. Then cycle through the result set. ie - $result-someFunction(); while ( $row = $result-fetchRow(DB_FETCHMODE_ASSOC) ) echo $row['id'] . ' ' . $row['name'] . br; So, the output here would be two of whatever was output. Does that make sense? Right now I'm having to do this: $sql = select id,name from sr_names order by name; $result = $db-query($sql); while ( $row = $result-fetchRow(DB_FETCHMODE_ASSOC) ) echo $row['id'] . ' ' . $row['name'] . br; $result = $db-query($sql); while ( $row = $result-fetchRow(DB_FETCHMODE_ASSOC) ) echo $row['id'] . ' ' . $row['name'] . br; If I already have the result set, can't I just tell it hey, put the cursor back at the top. I know I can fetchRow from a specific row in the result set, but then I'd have to get every row that way, which doesn't make efficiency sense, either. Thanks in advance, Jake LandEZ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] hi (php-SSH)
You can use putty. PuTTY is a free implementation of Telnet and SSH for Win32 platforms, along with an xterm terminal emulator. You can download from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Good luck Nato -Original Message- From: otherguy [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:34 AM To: David Smith Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] hi (php-SSH) On Monday, July 28, 2003, at 10:19 PM, David Smith wrote: Suman Aluru wrote: hi , is there any way to write a PHP program for SSH. I want to establish a SSH connection and work some commands in the remote system and close the connection. Yes, just do this (uses an SSH key file): ?php echo Executing remote command...br /; echo `ssh -i /path/to/key/file [EMAIL PROTECTED] ls /tmp`; echo Done executing remote command.br /; ? Use an SSH key file so you won't have to provide a password. I do this all the time for system administration, works great for inter-host communication. If you're going to go this route, I would suggest that you read up on the security issues inherent in using a non-passworded key file - and make sure that the privileges on the remote host are set accordingly. -Cameron Wilhelm -- 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] dbx complains that mssql is not loaded
Im running Apache 1.3.7 under RedHat 7.2 I've recompiled apache to load PHP as a module I've installed Freedts PHP has been recompiled to include mssql support (--with-mssql=/usr/local where Freedts puts its files) and with dbx support The following call in a php script: $link = dbx_connect (DBX_MYSQL, my.db.sever, db, username, password); results in this error message: Warning: dbx: module 'dbx_mssql' not loaded. in /var/www/html/test.php exactly what is it that should have been loaded? And where? Should i load mssql.so in php.ini? If yes, wher do i find it (its nowhere in my system) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Bar codes in PHP
You need the bar code scanner on the client side. PHP has nothing to deal with the bar code. I have implemented the bar code system for the online library management system for one reputed school at Chicago. For every book, system is generating the unique id and later on i am exporting these ids and printing in the bar code format. You can find that software by simple google search. Later on librarians are using the bar code scanner, which will pick up the unique id and look up in the database for further processing. I hope this is clear. Let me know if you have any doubt. Regards, Hardik --- CPT John W. Holmes [EMAIL PROTECTED] wrote: PHP wouldn't have anything to do with it. Your barcode should fill in a text area on a web page, which is the submitted to a PHP file for processing. You'll need something client site to get the code from the scanner to the web page. Unless you're talking about a program that acutally monitors the COM port that the scanner is plugged into on the server? ---John Holmes... - Original Message - From: Norma Ramirez - TECNOSOFT [EMAIL PROTECTED] To: lista php [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:19 PM Subject: [PHP-DB] Bar codes in PHP Hi all, does someone know how to capture or read bar codes from php? It will be great if I could do inputs to my database directly from bar codes in the products. Ideas??? Thank´s Norma Ramirez Area de Desarrollo Web [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Session help...
Sorry for the slightly off-topic post... I have a couple pages that use a login page. If the user tries to bring up one of these pages without being logged in, then the pages redirects him to the login page. After successful login, the user is directed back to the page they were attempting to originally load. For some reason, this is not working and I have been looking at this off and on for two days now without much luck. The first section of code is the snippet that directs users to the login page, and the second snippet is the code from the login page that sends users back. First code snippet... session_start(); if ($sbcuid $passwd) { mysql_select_db($database, $Prod); $query = select * from contacts_sa . where sbcuid='$sbcuid' and passwd='$passwd'; $result = mysql_query($query, $Prod) or die(mysql_error()); # $data = mysql_fetch_assoc($result); $test = mysql_num_rows($result); if (mysql_num_rows($result) 0 ) { $valid_user = $sbcuid; $_SESSION['valid_user'] = $sbcuid; } } if (!session_is_registered(valid_user)) { $return_url = $_SERVER['PHP_SELF']; $_SESSION['return_url'] = $return_url; header('Location: http://ldsa.sbcld.sbc.com/DW/sa_login.php'); exit(); } else { $sbcuid = $valid_user; } End of first snippet... Second code snippet... session_start(); if ($sbcuid $passwd) { if (isset($_SESSION['return_url'])) { $link = $_SESSION['return_url']; } else { $link = 'oncall_log.php'; } mysql_select_db($database, $Prod); $query = select * from contacts_sa . where sbcuid='$sbcuid' and passwd='$passwd'; $result = mysql_query($query, $Prod) or die(mysql_error()); # $data = mysql_fetch_assoc($result); $test = mysql_num_rows($result); if (mysql_num_rows($result) 0 ) { $valid_user = $sbcuid; # session_register(valid_user); $_SESSION['valid_user'] = $sbcuid; header(Location: http://.$_SERVER['HTTP_HOST'].$link); } } End of second snippet... Thanks in advance for any help. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Bar codes in PHP
Later on librarians are using the bar code scanner, which will pick up the unique id and look up in the database for further processing. Hardik this part it´s exactly what I want to know, how by using a php form, read or pick up as you say, the bar code and make an input to the database or something like that. Thank´s Norma -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] hi (php-SSH)
Brad Bonkoski wrote: Well, SSH has a server which woudl answer your requests and a lient to initiate the session, I'm assuming you wish to emulate the client side to initiate the session, of course PHP is a server side language, so it's not adding up. I have seen a JAVA applet that will open in a web browser on the client side to enable you to run an SSH client, perhaps this will server your needs? Try a google search. -Brad I believe you mean Mindterm (http://www.appgate.com/mindterm/) A great application, just remember to password protect the page if you decide to install it, there are a lot of people out there looking for mindterm's to abuse. -- R -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] hi (php-SSH)
could somebody tell me howto Generate the SSH key file to connect SSH without password from php Suman R Aluru -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 11:19 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] hi (php-SSH) Suman Aluru wrote: hi , is there any way to write a PHP program for SSH. I want to establish a SSH connection and work some commands in the remote system and close the connection. Yes, just do this (uses an SSH key file): ?php echo Executing remote command...br /; echo `ssh -i /path/to/key/file [EMAIL PROTECTED] ls /tmp`; echo Done executing remote command.br /; ? Use an SSH key file so you won't have to provide a password. I do this all the time for system administration, works great for inter-host communication. --Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RE: [PHP-DB] hi (php-SSH)
I *think* I set this to you yesterday... http://www.cs.umd.edu/~arun/misc/ssh.html -Brad - Original Message - From: Suman Aluru [EMAIL PROTECTED] Date: Tuesday, July 29, 2003 12:32 pm Subject: RE: [PHP-DB] hi (php-SSH) could somebody tell me howto Generate the SSH key file to connect SSH without password from php Suman R Aluru -Original Message- From: David Smith [EMAIL PROTECTED] Sent: Monday, July 28, 2003 11:19 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] hi (php-SSH) Suman Aluru wrote: hi , is there any way to write a PHP program for SSH. I want to establish a SSH connection and work some commands in the remote system and close the connection. Yes, just do this (uses an SSH key file): ?php echo Executing remote command...br /; echo `ssh -i /path/to/key/file [EMAIL PROTECTED] ls /tmp`; echo Done executing remote command.br /; ? Use an SSH key file so you won't have to provide a password. I do this all the time for system administration, works great for inter-host communication. --Dave -- 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] Form Submitting
Hi there everyone, I'm getting my results from the DB, but I need to submit the form using post to 2 iframes, I can get it to submit to 1 iframe, any ideas? I've checked google but can't find anything that seems to work with forms, only links with onclick :-( Not sure whether PHP or JScript will do it. Thanks Chris
[PHP-DB] Image Upload fails after Migration 4.0 -- 4.3...
hello everybody, my script fror uploading a number of images to a 777 mode directory worked fine all the time - until i decided to rebuild my machine from scratch with apache 2.0 (running virtual hosts) redhat 9.0 mysql 4.0.12 php 4.3 now when attempting to upload an image i keep getting the could not copy image... to... message, on some occasions even a confirmation of successful script execution but with no image actually uploaded.. i have checked my php.ini settings including upload permissions, max upload file size, location of tmp folder safe_mode etc. to no effect. does anybody have an idea that may stop me from buying a rope...? kind regards philip attached please find the delinquent for your scrutiny - $link_identifier = mysql_connect($hostname,$username,$passwd); if ($link_identifier=0) { echo mysql_errno().: .mysql_error().br; exit; } $now = date(YmdHis); $SQLStatement = insert into $databasename.hotel ( name, ort, land, kategorie, link, beschreibung, thumb1, // -- image thumbnail to upload bild1, // -- image to upload thumb2, // -- image thumbnail to upload bild2, // -- image to upload timestamp ) values ( '$name', '$ort', '$land', '$kategorie', '$link', '$beschreibung', '$thumb1path', '$bild1path', '$thumb2path', '$bild2path', '$now' ); $result = mysql_query($SQLStatement,$link_identifier); if (!$result) { echo mysql_errno().: .mysql_error().br; exit; } $id = mysql_insert_id($link_identifier); mysql_close($link_identifier);
[PHP-DB] postgres problems, undefined symbol: SortMem
Hi all, I am running Apache and PHP 4.3.2 with pgsql compiled in on RH8.0 (I know, I should choose better system :). When I'm trying to use PostgreSQL from web page scripts, I got this: Warning: Unable to load dynamic library '/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol: SortMem in /home/blah/whatso/php/register.php on line 3 and similar line is in Apache's error_log. And of course non of pgsql functions work. I was searching the web, but undefined symbol: SortMem seems to not appear at any mailing list or FAQs. Any suggestions? Ynse -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] alphabetical sorting... limiting and paginating on next set of letter group
Hi Guys, Rather long topic I know. Sorry if it annoyed anyone. Hopefully someone can help here with the logic on this. I have a query where I am getting one column (designers) in a Table, ordered alphabetically. Right now.. this query is displaying EVERY distinct result (45 in total). This result is used for a subcategory menu on a page. I need to shorten this up considerably. What I would like to do is: Pattern Designers: A/B/C Artists Collection The Barrick Samplers Bent Creek Bobbie G. Designs Calico Crossroads Charland Designs Country Cross Stitch Click for D/E/F Click for G/H/I Click for J/K/L When the user clicks on one of the another Letter Groupings... the A/B/C changes to whatever they selected as does the displayed results for their selection. Is this even possible? Thanks! Aaron
RE: [PHP-DB] alphabetical sorting... limiting and paginatingonnext set of letter group
On Wed, 2003-07-30 at 11:17, Aaron Wolski wrote: Hey, Thanks. Is there anyway this can be performed one function/loop? yes of course. =) just create a function that takes in two letters as a parameter, then build the query string from it. function($char_begin, $char_end) { $q_begin = strtolower($char_begin); $q_end = chr(ord(strtolower($char_begin))+1); $query = SELECT designer_name FROM designer WHERE designer_name BETWEEN '.$q_begin.' AND '.$q_end.' ORDER BY designer_name; //do your query here. } I knew it was possible with several queries.. I guess I was just looking for a all_in_one solution. Thanks for your help! Aaron -Original Message- From: Ramil G. Sagum [mailto:[EMAIL PROTECTED] Sent: July 29, 2003 11:07 PM To: Aaron Wolski Subject: Re: [PHP-DB] alphabetical sorting... limiting and paginating onnext set of letter group On Wed, 2003-07-30 at 10:36, Aaron Wolski wrote: Hi Guys, What I would like to do is: Pattern Designers: A/B/C Artists Collection The Barrick Samplers Bent Creek Bobbie G. Designs Calico Crossroads Charland Designs Country Cross Stitch Click for D/E/F Click for G/H/I Click for J/K/L When the user clicks on one of the another Letter Groupings... the A/B/C changes to whatever they selected as does the displayed results for their selection. Is this even possible? Aaron yes it is. =) try for a/b/c SELECT designer_name FROM designer WHERE designer_name BETWEEN 'a' AND 'd' ORDER BY designer_name; for d/e/f : SELECT designer_name FROM designer WHERE designer_name BETWEEN 'd' AND 'g' ORDER BY designer_name; for j/k/l: SELECT designer_name FROM designer WHERE designer_name BETWEEN 'j' AND 'm' ORDER BY designer_name; hope this helps. ramil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] alphabetical sorting... limiting and paginatingonnext set of letter group
function($char_begin, $char_end) { $q_begin = strtolower($char_begin); $q_end = chr(ord(strtolower($char_begin))+1); make that $q_end = chr(ord(strtolower($char_end))+1); sorry. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: Session help...
As mentioned previously in this list, $_SESSION and session_register, session_is_register, is not compatible with each other. Anyway, I used your idea as inspiration for my own code.. My code works.. Try to change From: if (!session_is_registered(valid_user)) { To: if ($_SESSION['valid_user']){ //your code } Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 9:19 PM To: [EMAIL PROTECTED] Subject: Session help... Sorry for the slightly off-topic post... I have a couple pages that use a login page. If the user tries to bring up one of these pages without being logged in, then the pages redirects him to the login page. After successful login, the user is directed back to the page they were attempting to originally load. For some reason, this is not working and I have been looking at this off and on for two days now without much luck. The first section of code is the snippet that directs users to the login page, and the second snippet is the code from the login page that sends users back. First code snippet... session_start(); if ($sbcuid $passwd) { mysql_select_db($database, $Prod); $query = select * from contacts_sa . where sbcuid='$sbcuid' and passwd='$passwd'; $result = mysql_query($query, $Prod) or die(mysql_error()); # $data = mysql_fetch_assoc($result); $test = mysql_num_rows($result); if (mysql_num_rows($result) 0 ) { $valid_user = $sbcuid; $_SESSION['valid_user'] = $sbcuid; } } if (!session_is_registered(valid_user)) { $return_url = $_SERVER['PHP_SELF']; $_SESSION['return_url'] = $return_url; header('Location: http://ldsa.sbcld.sbc.com/DW/sa_login.php'); exit(); } else { $sbcuid = $valid_user; } End of first snippet... Second code snippet... session_start(); if ($sbcuid $passwd) { if (isset($_SESSION['return_url'])) { $link = $_SESSION['return_url']; } else { $link = 'oncall_log.php'; } mysql_select_db($database, $Prod); $query = select * from contacts_sa . where sbcuid='$sbcuid' and passwd='$passwd'; $result = mysql_query($query, $Prod) or die(mysql_error()); # $data = mysql_fetch_assoc($result); $test = mysql_num_rows($result); if (mysql_num_rows($result) 0 ) { $valid_user = $sbcuid; # session_register(valid_user); $_SESSION['valid_user'] = $sbcuid; header(Location: http://.$_SERVER['HTTP_HOST'].$link); } } End of second snippet... Thanks in advance for any help. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php