[PHP-DB] please help.. serial number generator

2002-07-30 Thread rainydays_sunshine
Any ideas how to generate a unique serial number that you can check that it's valid.. Thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Percentage...

2002-07-30 Thread JJ Harrison
OK, here is the answer in (unedited except for comments)code: $query = select count(vid) as total_qs from poll_vote where pid = $pid; // count the number of fields in the table $result = mysql_query($query) or die(Query failed: $querybr . mysql_error()); $row = mysql_fetch_array($result);

[PHP-DB] Re: please help.. serial number generator

2002-07-30 Thread JJ Harrison
if u are looking for a simple random string try this php: echo md5(time()); or md5() a random number your choice. md5() genetates a one way non-reversable hash. which could be kept in a db. here is an example of the md5 hash of my library card number: 11d560821fb027c227d837df53a5a73a md5()

[PHP-DB] Re: please help.. serial number generator

2002-07-30 Thread rainydays_sunshine
I need to create some kind of 10 digits serial number where I can generate and check that it is valid. Sort of like a checksum.. Jj Harrison [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if u are looking for a simple random string try this php: echo

[PHP-DB] mySQL max connections

2002-07-30 Thread Shane Wright
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I have a database thats taking a bit of a hammering - enough so that the number of connections spirals up and out of control. max_connections was originally at the default of 100 - but rising above 50 or so meant actual throughput dropped so

[PHP-DB] How can you include an https?

2002-07-30 Thread Camelia Enderby
Hi guys, Just stumble on this problem. I need to be able to include a file from another server into one of my script. Not to difficult except that the file is on a secure server and it doesn't seem to work. Anybody knows of a way around. I have php 4 running on Red Hat with mysql databse.

Re: [PHP-DB] How can you include an https?

2002-07-30 Thread Paul Burney
on 7/30/02 9:10 AM, Camelia Enderby at [EMAIL PROTECTED] appended the following bits to my mbox: Just stumble on this problem. I need to be able to include a file from another server into one of my script. Not to difficult except that the file is on a secure server and it doesn't seem to

[PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
I'm running MySQL 3.23.47 and PHP 4.1.2 on Mac OS X 10.1.5. In my table, I've got two fields: Name VARCHAR(35) and txtSWDesc1 TEXT. According to the manual, TEXT will give me a maximum space of 65,536 bytes per field. I've entered text in this field in the amount of approximately 500 characters.

Re: [PHP-DB] mySQL max connections

2002-07-30 Thread Rasmus Lerdorf
I would suggest looking into MySQL's replication support. Split reads and writes so they go to separate servers. That is, create a master server where you send all database writes. And do all reads on the replicated slave servers. Have a look at this presentation I gave last week on this

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Andrey Hristov
Maybe it will help you but I've read that when using persistent connections PHP uses 2 on every request. So if in one moment you have 10 scripts,that use persistent connections, running you will have 20 connections used to the mysql. Regards, Andrey - Original Message - From: Paul

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
Thank you for that idea. I don't think that's it, though, because this script is the only one I'm ever running on this site. The problem is perfectly consistent and repeatable, which leads me to believe it's something in the way the array is being built. Paul Worthington [EMAIL PROTECTED]

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Andrey Hristov
Do you have PhpMyAdmin installed? If you have try with it to see the results. It uses native mysql functions. Andrey - Original Message - From: Paul Worthington [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 7:53 PM Subject: Re: [PHP-DB] mysql_fetch_array limit? -

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
No I don't have PhpMyAdmin installed. I work directly in MySQL via a terminal, so all my checking is with native calls anyway. Working natively in MySQL, all my data is there and everything works the way I expect it to. Using mysql_fetch_array() in PHP results in a truncated result set. And I am

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Rasmus Lerdorf
What do you mean it uses 2? It does not. On Tue, 30 Jul 2002, Andrey Hristov wrote: Maybe it will help you but I've read that when using persistent connections PHP uses 2 on every request. So if in one moment you have 10 scripts,that use persistent connections, running you will have 20

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Andrey Hristov
Hello, last week I read this article : http://phplens.com/lens/php-book/optimizing-debugging-php.php It is long one. Extract from it (look where is it and read around it): [snip] Overload on 40 connections When we pushed the benchmark to use 40 connections, the server overloaded with 35%

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Rasmus Lerdorf
The only reason it uses two is if the code using persistent connections connects with different credentials. ie. you have 2 different apps on the same server that connects as 2 different user ids and they are both using persistent connections. Eventually every httpd will have 2 connections. -R

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Andrey Hristov
Yeaah! I am a fool. My biggest excuses. Sorry Rasmus and everyone else. Andrey - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Andrey Hristov [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 8:11 PM Subject: Re: [PHP-DB] mysql_fetch_array limit? -

RE: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Roedel, Mark A.
-Original Message- From: Paul Worthington [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 30, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql_fetch_array limit? - more details What happens is I'm only getting the first 256 characters of txtSWDesc1 displayed in my

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Kodrik
I use mysql_fetch array to retrieve large text data many many times without a problem. I've actually written functions to retrieve the data for me using this function, and I never had a single problem, truncated or speed, on Unix, Linux or Windows platform. Check out the code for the

RE: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Hutchins, Richard
One thing I haven't seen yet is a cut-n-paste of your db tables. Could you post that to this list? Maybe there's something you're overlooking there? Maybe seomebody will find something amiss there. I know it sounds simple and you might think you have it all down right, but how many times have

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Burney
on 7/30/02 10:34 AM, Paul Worthington at [EMAIL PROTECTED] appended the following bits to my mbox: I'm using this PHP code, very simple and straightforward, to select two columns into an array and then display the results in an HTML table:

[PHP-DB] Comparison with formatted numbers

2002-07-30 Thread Terry Romine
I've run into a sticky case where my query is failing (PHP4.x/MySQL). I have a table where the price value is imported from an external source, so I can't change it on the fly, and they embed thousands seperators (in my case ','). When I try to do a query such as .. where price = '25' ..

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
I am a bonehead. In stripping down my code for posting here, the problem suddenly went away. I was building a temporary table and all this time I've been overlooking the fact that my txtSWDesc1 field in the tmp table was set to 255. My apologies to everyone. And thanks for trying to help me.

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
My mistake: I was setting the limit myself via an incorrect column definition whilst creating a temporary table. I feel so stupid. Thanks for trying to help me. Paul Kodrik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use mysql_fetch array to retrieve

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
Problem solved. I was stupidly overlooking an incorrect column definition in a temporary table. Everything's fine now. Thank you so much for trying to help me, and please excuse my errors. Paul Richard Hutchins [EMAIL PROTECTED] wrote in message

Re: [PHP-DB] mysql_fetch_array limit? - more details

2002-07-30 Thread Paul Worthington
Thanks for all your helpful suggestions. It turns out I was limiting the array myself by setting a temporary table column definition to varchar(255). I have been overlooking it all this time. I feel so stupid. Thanks again for trying to help me. Paul Paul Burney [EMAIL PROTECTED] wrote in

RE: [PHP-DB] time field query problems.

2002-07-30 Thread Steve Bradwell
Thanks, I wasn't sure what kind of field to use, I'll give the timestamp a try and set 0 as default. Regards, Steve. -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 6:34 PM To: Steve Bradwell; [EMAIL PROTECTED]; Php-Db (E-mail) Subject: Re:

[PHP-DB] A little upgrade help...

2002-07-30 Thread NIPP, SCOTT V (SBCSI)
I am upgrading from PHP 4.1.2 to 4.2.2, and I cannot get the make install to work. I am doing this on HP-UX 11.00, and I have tried the suggestion of renaming the libphp4.sl files to libphp4.so, but I still get failures. Below is the output of the make install before changing the

Re: [PHP-DB] Comparison with formatted numbers

2002-07-30 Thread leo g. divinagracia iii
try the good ol' SETTYPE function to set the variable type from string to numeric and visa versa... http://www.php.net/manual/en/function.settype.php Terry Romine wrote: I've run into a sticky case where my query is failing (PHP4.x/MySQL). I have a table where the price value is imported

[PHP-DB] Re: Auto Increment Problems....

2002-07-30 Thread Joel Boonstra
[straying OT, but...] Instead of incrementing to find the next row to count them, you dont have to set the ID if it is auto increment. MySQL will do it for you (and i think it might fill the holes too). Also, to get the num. of rows just do this - $get_rows = mysql_query(SELECT * FROM

Re: [PHP-DB] dynamic pages

2002-07-30 Thread eat pasta type fasta
look up HTTP_POST_VARS an related, it's used to retrieve the form data when globals are off. I would like to have the same page (test.php) have different text in it depending on a database entry. which is easy enough. but I want it to be on the fly. example list would be created on the fly

[PHP-DB] Re: [PHP-DEV] [CROSS POST] PHP Meetup Texas PHP Users

2002-07-30 Thread Gabriel Ricard
Jay Blanchard wrote: Howdy all! Just wanted to remind everyone that sign-up for the PHP Meetup is still in progress at http://php.meetup.com . At latest count there are 289 folks signed up world-wide with the top 10 cities being; Washington DC (9 members) Toronto (9 members) Leeds, UK

Re: [PHP-DB] Re: please help.. serial number generator

2002-07-30 Thread leo g. divinagracia iii
use the MD5 function and just take the 1st 10 chars or better yet, once you have the MD5 value, use a wacky routine to take the first 10 odd position values... since each time you run the function, it will always return the same value (given the same string parameter...). [EMAIL PROTECTED]