[PHP-DB] mysql lock

2003-06-27 Thread anders thoresson
Hi, I've never used a lock on a MySQL table so far, but need one now. Two questions: 1. Do I set the lock by a normal query, but in the form of LOCK TABLE tablename WRITE, instead of SELECT * FROM tablename WHERE x = 1? 2. Can I set the lock in one query, then perform multiple other queries

Re: [PHP-DB] generating sequence without AUTO_INCREMENT

2003-06-27 Thread Lester Caine
Doing what I wanted to do took six hours and 120 lines of code, all in all, but I learnt a good deal on the way. ;-) At times, manual intervention can be a lifesaver. You have already said that you have to 'ring fence' bank holidays, and weekends, so someone has to check or enter the bank

RE: [PHP-DB] error checking question

2003-06-27 Thread Ford, Mike [LSS]
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 26 June 2003 20:22 What I would like to do is somehow have a redundant error check on the server side and then display an error message above the form on the main page should fields be left blank or

RE: [PHP-DB] latest version of php only cgi?

2003-06-27 Thread Ford, Mike [LSS]
-Original Message- From: Doug Finch [mailto:[EMAIL PROTECTED] Sent: 26 June 2003 21:12 Is the newest version of php 4 only available as a cgi-based program? DF No. Cheers! Mike - Mike Ford, Electronic

[PHP-DB] Re: php-db Digest 25 Jun 2003 15:10:42 -0000 Issue 1899

2003-06-27 Thread JeRRy
From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Wed, 25 Jun 2003 04:03:53 +0800 Subject: Re: [PHP-DB] md5 question! Plain Text Attachment [ Save to my Yahoo! Briefcase | Download File ] On Tuesday 24 June 2003 22:36, Peter Beckman wrote: Most sites save/allow an 8

RE: [PHP-DB] Splitting Product Catalogue Over Multiple Pages?

2003-06-27 Thread Gary . Every
If you're trying to do paging, it's quite simple (there are tons of examples out there, search google for paging php) $sql = select count(*) from table_name $number_of_records = mysql_query($sql); $pointer=0; $recs_per_page=20; if($number_of_records $recs_per_page) { // do a limit and

Re: [PHP-DB] Splitting Product Catalogue Over Multiple Pages?

2003-06-27 Thread Boa Constructor
Gary, thanks for your reply, I think I'll need 2 have a think about this. I didn't totally understand: You limit the query by LIMIT starting_point,number_of_records_to_return at the end of the sql statement. I've never used LIMIT before, could you explain this a bit more or point me to some

[PHP-DB] re:[PHP-DB] Splitting Product catalog

2003-06-27 Thread Michael Lewis
Graeme, Use a select string as in, $sel=select * from product where price100 order by price LIMIT 0,100; This would result in the query only returning the first 100 records. If you want to page through them (back and next links). You would have to save the current start point and the length

RE: [PHP-DB] Splitting Product Catalogue Over Multiple Pages?

2003-06-27 Thread Gary . Every
LIMIT 0,10 will return the first ten records of a result set. To make more sense, you should do an ORDER BY of some field to get the info sorted correctly. LIMIT takes 1 or two arguments If there is only one argument, say 10, it will return the first ten records. If there are two arguments, LIMIT

Re: [PHP-DB] re:[PHP-DB] Splitting Product catalog

2003-06-27 Thread Boa Constructor
Michael, thank you so much for that code. I think I could maybe get this working properly. I've got 2 categories and 4 products in each and I want to split them in to 2 pages, 2 products on each. So obviously I will have 2 links at the bottom page 1 2.. etc when I click the link 2 I will

Re: [PHP-DB] Splitting Product Catalogue Over Multiple Pages?

2003-06-27 Thread Boa Constructor
RE: [PHP-DB] Splitting Product Catalogue Over Multiple Pages?Ahhh rite, I think I get this, I've just posted another question but I think I it will work if I do it the way I suggest in my last post. If not please let me know. Thank you both Gary and Michael! Cheers, Graeme :) -

[PHP-DB] redirection checking

2003-06-27 Thread Doug Finch
I am compiling latest PHP4 and get a warning telling me that I am about to compile without redirection checking. Should I be concerned about this? If so, what flag should I use in the config to alleviate this? DF -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] Re: Efficiency question

2003-06-27 Thread Micah Stevens
Peter and Hugh, The queries are already mostly optimized. I just was using that one as an example. I'll be going through them and tweaking them, but know that about the variable assignments helps for sure. Thanks! On Thu June 26 2003 10:49 pm, Peter Beckman wrote: Since this is the PHP DB

[PHP-DB] Altering a column in an existing table

2003-06-27 Thread Rick Dahl
I have a column (ID) that is currently not auto_incremental. I need to change it so that it is auto_incremental. There are already records in this column. also, I need to change the field type from int(4) to int(8). Rick

Re: [PHP-DB] Altering a column in an existing table

2003-06-27 Thread Leif K-Brooks
Rick Dahl wrote: I have a column (ID) that is currently not auto_incremental. I need to change it so that it is auto_incremental. There are already records in this column. also, I need to change the field type from int(4) to int(8). Rick 1) This has nothing to do with PHP. 2) This will