[PHP] phpMyAdmin--resetting auto increments to 0
hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex At the top of the Structure page ( or any other when viewing a detailed table view) you should have an Empty tab at the top left. Hit that and it should reset the counter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
Jim Lucas wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex At the top of the Structure page ( or any other when viewing a detailed table view) you should have an Empty tab at the top left. Hit that and it should reset the counter also running the command: DELETE FROM `table_name` from the SQL box, should do the same trick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
On 4/16/06, Jim Lucas [EMAIL PROTECTED] wrote: Jim Lucas wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex At the top of the Structure page ( or any other when viewing a detailed table view) you should have an Empty tab at the top left. Hit that and it should reset the counter also running the command: DELETE FROM `table_name` from the SQL box, should do the same trick That won't reset the counter. You'll probably need to do this after you delete all the data: update table set id=0; -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
chris smith wrote: On 4/16/06, Jim Lucas [EMAIL PROTECTED] wrote: Jim Lucas wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex At the top of the Structure page ( or any other when viewing a detailed table view) you should have an Empty tab at the top left. Hit that and it should reset the counter also running the command: DELETE FROM `table_name` from the SQL box, should do the same trick That won't reset the counter. You'll probably need to do this after you delete all the data: update table set id=0; -- Postgresql php tutorials http://www.designmagick.com/ Well, I just tried it on a temp table that I have for my blog under Mysql and it did reset the autoindex to 1. Seems to work the way I said. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
On 4/16/06, Jim Lucas [EMAIL PROTECTED] wrote: chris smith wrote: On 4/16/06, Jim Lucas [EMAIL PROTECTED] wrote: Jim Lucas wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex At the top of the Structure page ( or any other when viewing a detailed table view) you should have an Empty tab at the top left. Hit that and it should reset the counter also running the command: DELETE FROM `table_name` from the SQL box, should do the same trick That won't reset the counter. You'll probably need to do this after you delete all the data: update table set id=0; -- Postgresql php tutorials http://www.designmagick.com/ Well, I just tried it on a temp table that I have for my blog under Mysql and it did reset the autoindex to 1. Seems to work the way I said. Hmm, well there you go. Thanks for letting us know :) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Common Files
Shaun wrote: Hi, We have a dedicated UNIX server running FreeBSD, is it possible to set a directory where we can place a set of common files that can be used by all of our web sites? yes, but if you use openbase_dir then don't forget to add the relevant dir to the openbase_dir list. include_path is your friend when doing something like what you are asking about. also check out PEAR (pear.php.net) which does exactly what you asked about, the pear system may give you more/some ideas about how to structure and access you common files. Thanks for your advice -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Common Files
On 16/04/06, Jochem Maas [EMAIL PROTECTED] wrote: Shaun wrote: Hi, We have a dedicated UNIX server running FreeBSD, is it possible to set a directory where we can place a set of common files that can be used by all of our web sites? also check out PEAR (pear.php.net) which does exactly what you asked about, the pear system may give you more/some ideas about how to structure and access you common files. I tend to collect all my common code into a single directory heirarchy, and put a copy into the systems' PEAR directory. Then I can just go require_once 'MyCompany/filename.php'; from anywhere on the system. Until PEAR produces a module called 'MyCompany' (unlikely), it will live there entirely happily. Alister -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Common Files
Alister Bulman wrote: On 16/04/06, Jochem Maas [EMAIL PROTECTED] wrote: Shaun wrote: Hi, We have a dedicated UNIX server running FreeBSD, is it possible to set a directory where we can place a set of common files that can be used by all of our web sites? also check out PEAR (pear.php.net) which does exactly what you asked about, the pear system may give you more/some ideas about how to structure and access you common files. I tend to collect all my common code into a single directory heirarchy, and put a copy into the systems' PEAR directory. Then I can just go require_once 'MyCompany/filename.php'; from anywhere on the system. Until PEAR produces a module called 'MyCompany' (unlikely), it will live there entirely happily. sounds like a good plan - in the future you could even consider setting up your own pear channel (pear server) which houses custom packages (e.g. 'MyCompany') which you could then install into any pear installation you need it. just a thought :-) Alister -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: can somebody explain why $this-param = $this-SYSTEM-db-answer + $this-param; is causing the error Fatal error: Unsupported operand types in /var/www/current/mjguest/modules/settings.php on line 52 context is function settings($SYSTEM) { $this-SYSTEM = $SYSTEM; $this-SYSTEM-db-ask(1, 'settings_load'); $this-SYSTEM-db-get_row(); $this-param = $this-SYSTEM-db-answer + $this-param; } -- what are they trying to do//? for what does param mean question, param is just above that part.. class settings { var $SYSTEM; var $param = array // Maximum length for web site title ( 'titlelen' = 28 # DEFAULT: 28 # MAXIMUM: 50 // Maximum length for administrator email , 'adminmaillen' = 50 # DEFAULT: 50 # MAXIMUM: 80 // Max Width and Height of avatars thumbnails (in pixels) , 'userpic' = array ( 'width' = 60 # Width in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT , 'height'= 60 # Height in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT ) // Available date-time formats (valid patterns for php date() function) , 'dateformats' = array ( 'd.m.Y h:ia'= 'D.M.Y 12h' # Business international , 'm/d/Y h:ia'= 'M/D/Y 12h' # American , 'Y-m-j h:ia'= 'Y-M-D 12h' # Asian , 'd/m/Y H:i' = 'D/M/Y 24h' # European , 'F, jS Y h:ia' = 'MM, Dth Y 12h' # English , 'd.m.Y @ B .\b\e\a\t' = 'D.M.Y @ .beat' # Swatch(R) Internet time )# PATTERN = REPRESENTATION ); function settings($SYSTEM) { $this-SYSTEM = $SYSTEM; $this-SYSTEM-db-ask(1, 'settings_load'); $this-SYSTEM-db-get_row(); $this-param = $this-SYSTEM-db-answer + $this-param; } the db-answer is ... function ask() { $qparams = func_get_args(); $this-__lastquestion = $qparams[1]; $this-query($qparams[0], strtr(vsprintf($this-questions[$qparams[1]], array_slice($qparams, 2)), $this-tables)); } function get_field($num = 0) { $this-answer = @mysql_fetch_row($this-__cachedquery); return ($this-answer ? $this-answer[$num] : $this-__error()); } function get_row() { $this-answer = @mysql_fetch_assoc($this-__cachedquery); return ($this-answer ? true : $this-__error()); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
On 4/16/06, kmh496 [EMAIL PROTECTED] wrote: can somebody explain why $this-param = $this-SYSTEM-db-answer + $this-param; is causing the error Fatal error: Unsupported operand types in /var/www/current/mjguest/modules/settings.php on line 52 context is function settings($SYSTEM) { $this-SYSTEM = $SYSTEM; $this-SYSTEM-db-ask(1, 'settings_load'); $this-SYSTEM-db-get_row(); $this-param = $this-SYSTEM-db-answer + $this-param; } What is $this-param set to initially? What is $this-SYSTEM-db-answer ? use gettype and see what they are: echo gettype($this-param) . 'br/'; echo gettype($this-SYSTEM-db-answer) . 'br/'; -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
On 4/16/06, kmh496 [EMAIL PROTECTED] wrote: 2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: can somebody explain why $this-param = $this-SYSTEM-db-answer + $this-param; is causing the error Fatal error: Unsupported operand types in /var/www/current/mjguest/modules/settings.php on line 52 context is function settings($SYSTEM) { $this-SYSTEM = $SYSTEM; $this-SYSTEM-db-ask(1, 'settings_load'); $this-SYSTEM-db-get_row(); $this-param = $this-SYSTEM-db-answer + $this-param; } -- what are they trying to do//? for what does param mean question, param is just above that part.. class settings { var $SYSTEM; var $param = array // Maximum length for web site title ( 'titlelen' = 28 # DEFAULT: 28 # MAXIMUM: 50 // Maximum length for administrator email , 'adminmaillen' = 50 # DEFAULT: 50 # MAXIMUM: 80 // Max Width and Height of avatars thumbnails (in pixels) , 'userpic' = array ( 'width' = 60 # Width in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT , 'height'= 60 # Height in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT ) // Available date-time formats (valid patterns for php date() function) , 'dateformats' = array ( 'd.m.Y h:ia'= 'D.M.Y 12h' # Business international , 'm/d/Y h:ia'= 'M/D/Y 12h' # American , 'Y-m-j h:ia'= 'Y-M-D 12h' # Asian , 'd/m/Y H:i' = 'D/M/Y 24h' # European , 'F, jS Y h:ia' = 'MM, Dth Y 12h' # English , 'd.m.Y @ B .\b\e\a\t' = 'D.M.Y @ .beat' # Swatch(R) Internet time )# PATTERN = REPRESENTATION ); function settings($SYSTEM) { $this-SYSTEM = $SYSTEM; $this-SYSTEM-db-ask(1, 'settings_load'); $this-SYSTEM-db-get_row(); $this-param = $this-SYSTEM-db-answer + $this-param; } the db-answer is ... function ask() { $qparams = func_get_args(); $this-__lastquestion = $qparams[1]; $this-query($qparams[0], strtr(vsprintf($this-questions[$qparams[1]], array_slice($qparams, 2)), $this-tables)); } function get_field($num = 0) { $this-answer = @mysql_fetch_row($this-__cachedquery); return ($this-answer ? $this-answer[$num] : $this-__error()); } function get_row() { $this-answer = @mysql_fetch_assoc($this-__cachedquery); return ($this-answer ? true : $this-__error()); } Sounds like you have a bad query and instead of answer being a row, it's something else. Print out everything before you use it: instead of: $this-param = $this-SYSTEM-db-answer + $this-param; $answer = $this-SYSTEM-db-answer; $param = $this-param; echo Answer: . $answer . br/; If that's not an array, that's your problem and you'll have to debug why it's not an array. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] Fatal error: Unsupported operand types
2006-04-16 (일), 21:02 +1000, chris smith 쓰시길: On 4/16/06, kmh496 [EMAIL PROTECTED] wrote: 2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: can somebody explain why $this-param = $this-SYSTEM-db-answer + $this-param; is causing the error Fatal error: Unsupported operand types in /var/www/current/mjguest/modules/settings.php on line 52 Sounds like you have a bad query and instead of answer being a row, it's something else. Print out everything before you use it: instead of: $this-param = $this-SYSTEM-db-answer + $this-param; $answer = $this-SYSTEM-db-answer; $param = $this-param; echo Answer: . $answer . br/; If that's not an array, that's your problem and you'll have to debug why it's not an array. -- list and especially dmajick @ gmail, thanks for your help. i will have to debug later, i am sorry, i have to run right now. frankly speaking, i am simply having a bad day. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
kmh496 wrote: can somebody explain why $this-param = $this-SYSTEM-db-answer + $this-param; is causing the error no. because: a, you don't mention the version of php you use b, we don't have knowledge of you codebase (posting code listings for a complete class really isn't going to help much) have you tried to debug the problem? using print_r() or var_dump()? e.g.: ... Fatal error: Unsupported operand types in /var/www/current/mjguest/modules/settings.php on line 52 context is function settings($SYSTEM) { $this-SYSTEM = $SYSTEM; $this-SYSTEM-db-ask(1, 'settings_load'); $this-SYSTEM-db-get_row(); echo 'pre'; var_dump($this-SYSTEM-db-answer, $this-param) echo '/pre'; $this-param = $this-SYSTEM-db-answer + $this-param; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions: Search in array and detect JS
don't know if someone mentioned it already but i was digging around in the docs for something completely different and bumped into this: preg_grep() [http://php.net/preg_grep] and I thought of your question, might be just what your looking for. I can't remember having come across this func before - learn something new every day :-) Ryan A wrote: Hi, Like the subject says; I have two questions: 1) Is it possible to detect JavaScript via php... and yes I do know that JS is client side while PHP is server...but how else to do it? The reason I ask is before serving an AJAX page I would like to make sure JS is enabled, if not, serve the other normal page... I am sure I am not the first person to come accross this little problem, how did you solve it? I have seen some suggestions on google like having a hidden form field and using js to put a value in it, if it exists when the form is sent then JS is on..if not, its not... but that method is not the best in an AJAX situation...right? 2) How can I search in an array for a particular word? eg: in an array movie I have this kind of data: movie_name= some movie cast= Jim Carrey, Richard Pryor, Eddie Murphy I want to search on either Richard or Richard Pryor (must be case insensitive too) something like a SELECT with a LIKE %% statement I have been fooling around with in_array() but not getting anywhere fast. am I on the right track? Links, code examples or advise would be as alwaysappreciated. Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex Select the desired database on the left. The browser will reload and show the STRUCTURE page. Click on the SQL tab; the browser should now load a page with a textarea that says Run SQL query/queries on database FOOBAR. Enter the following in the textarea: ALTER TABLE footable auto_increment=0; and then press the GO button. You can set the auto_increment number to any positive integer, AFAIK, though there might be a limit. :-) Kevin Kinsey -- Just because you're paranoid doesn't mean they AREN'T after you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't make shorthand work in PHP5
Dear List, The shorthand form ?=$printthis? worked fine for me in PHP4, but I cannot make it work in PHP5. (?php print($printthis); ? works ok, however). Could anybody please tell me if this form is still available in PHP5, and, if so, if a different syntax is needed? I searched the matter in the documentation but couldn't find it. Thank you Alberto Brea [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't make shorthand work in PHP5
Hello, Check your php.ini configuration, there is an option to activate this option. [EMAIL PROTECTED] wrote: Dear List, The shorthand form ?=$printthis? worked fine for me in PHP4, but I cannot make it work in PHP5. (?php print($printthis); ? works ok, however). Could anybody please tell me if this form is still available in PHP5, and, if so, if a different syntax is needed? I searched the matter in the documentation but couldn't find it. Thank you Alberto Brea [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
At 4:46 PM +1000 4/16/06, alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex Alex: This always works for me in mySQLAdmin. 1. Delete the first record. 2. Reset the auto_increment to whatever you want. 3. Insert a record. 4. Delete that record. After that, the next record will start at the new auto_increment. Don't ask why, that's just the way it works. If you want to reset the ID from within php, try this: // Renumber the Existing 'id' Sequence alter table $table_name drop id, add id int unsigned not null auto_increment first, auto_increment = 1; But, don't tell anyone that you did it AND especially don't tell anyone I gave you the code. This is a big no-no as decreed by the dB Gods and is seldom committed to written word. :-) tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
Alex, Heres a very simple way to do exactly what you want as long as you are deleting all the records from the table: once you are in phpmyadmin you should have a frame with the database name(s) on the left and the tables on the right, click on the database name so that you have a list of tables in the right frame...click the table you want to reset on the left frame, the right frame will reload with that tables details then on the top right you will find a link that says empty click that and it will delete everything and reset everything Another way would be to simply export the table structure, drop the table and create it again... HTH Cheers, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin--resetting auto increments to 0
Oops sorry, I made a little mistake here: click on the database name so that you have a list of tables in the *right* frameI meant: click on the database name so that you have a list of tables in the *LEFT* frameCheers,Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't make shorthand work in PHP5
On 4/16/06, cajbecu [EMAIL PROTECTED] wrote: Hello, Check your php.ini configuration, there is an option to activate this option. Might help to tell them what it is.. Look for short_open_tag. http://www.php.net/manual/en/ini.core.php (you can enable it with a htaccess file if need be). [EMAIL PROTECTED] wrote: Dear List, The shorthand form ?=$printthis? worked fine for me in PHP4, but I cannot make it work in PHP5. (?php print($printthis); ? works ok, however). Could anybody please tell me if this form is still available in PHP5, and, if so, if a different syntax is needed? I searched the matter in the documentation but couldn't find it. Thank you -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Include Problem
Ups, I forgot to reply to everyone again, sorry. -- Forwarded message -- From: Martin Alterisio [EMAIL PROTECTED] Date: 16-abr-2006 13:53 Subject: Re: [PHP] Include Problem To: Shaun [EMAIL PROTECTED] You're using an absolute path to the file, maybe what you really meant to do was: include(cms/templates/footer.php); 2006/4/15, Shaun [EMAIL PROTECTED]: Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] phpMyAdmin--resetting auto increments to 0
[snip] i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful [/snip] Darned basic SQL; TRUNCATE table Will empty the table and reset the auto-increment back to the beginning. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Bar codes
Barcodes On The Fly With GD http://www.weberdev.com/get_example-184.html Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com PHP MySQL Forums : http://www.weberforums.com Learn PHP MySQL Playing Trivia : http://www.webertrivia.com SEO Data Monitor http://seo.weberdev.com -Original Message- From: Emil Edeholt [mailto:[EMAIL PROTECTED] Sent: Thursday, April 13, 2006 5:50 PM To: php-general@lists.php.net Subject: [PHP] Bar codes Hi, I've never used bar codes before. And now I need to print out bar codes, and I've been told it should be in the format K39 Normal (I could have misunderstood since I can't find that on google. Maybe Code 39 Normal?). Any idea how to find that bar code font or what it's called? And what shall I use to print it out? Is it just as a regulat font, or do I need some special bar code lib? Thanks for your time Best regards Emil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: phpMyAdmin--resetting auto increments to 0
alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex On a related note (he did say PhpMyAdmin) ... ALTER TABLE 'tablename' auto_increment=n works, but I can't get PhpMyAdmin to reset the auto_increment through the Operations menu page. If I go to the Operations tab for a table and set the auto_increment value to something less that it currently is, PhpMyAdmin will not honor my request and re-specifies the current auto_increment value in the ALTER TABLE command (even though my requested value is valid). Is this because of a config setting? I could have sworn earlier versions would obey my request. -- * Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: phpMyAdmin--resetting auto increments to 0
At 1:42 PM -0600 4/16/06, Chuck Anderson wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex On a related note (he did say PhpMyAdmin) ... ALTER TABLE 'tablename' auto_increment=n works, but I can't get PhpMyAdmin to reset the auto_increment through the Operations menu page. If I go to the Operations tab for a table and set the auto_increment value to something less that it currently is, PhpMyAdmin will not honor my request and re-specifies the current auto_increment value in the ALTER TABLE command (even though my requested value is valid). Is this because of a config setting? I could have sworn earlier versions would obey my request. Chuck: This always works for me in PhpMyAdmin (I mistyped it before). 1. Delete the first record. 2. Reset the auto_increment in Operations to whatever you want. 3. Insert a record. 4. Delete that record. After that, the next record will start at the new auto_increment value. Don't ask why, that's just the way it works. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0
tedd wrote: At 1:42 PM -0600 4/16/06, Chuck Anderson wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex On a related note (he did say PhpMyAdmin) ... ALTER TABLE 'tablename' auto_increment=n works, but I can't get PhpMyAdmin to reset the auto_increment through the Operations menu page. If I go to the Operations tab for a table and set the auto_increment value to something less that it currently is, PhpMyAdmin will not honor my request and re-specifies the current auto_increment value in the ALTER TABLE command (even though my requested value is valid). Is this because of a config setting? I could have sworn earlier versions would obey my request. Chuck: This always works for me in PhpMyAdmin (I mistyped it before). 1. Delete the first record. 2. Reset the auto_increment in Operations to whatever you want. 3. Insert a record. 4. Delete that record. After that, the next record will start at the new auto_increment value. Don't ask why, that's just the way it works. tedd That would work, except that I want to change the auto_increment without deleting the first record. During testing I may add many entries to the end of an existing database table. When I am done testing I want to delete those extraneous entries (leaving the earlier entries intact). Call me obsessive/compulsive or whatever, but I like to knock the auto_increment value back down to the next valid value (what was the first test value). PhpMyAdmin refuses to use the valid auto_increment value I specify in Operations and I have to edit the query to set it right. -- * Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0
At 3:01 PM -0600 4/16/06, Chuck Anderson wrote: tedd wrote: At 1:42 PM -0600 4/16/06, Chuck Anderson wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex On a related note (he did say PhpMyAdmin) ... ALTER TABLE 'tablename' auto_increment=n works, but I can't get PhpMyAdmin to reset the auto_increment through the Operations menu page. If I go to the Operations tab for a table and set the auto_increment value to something less that it currently is, PhpMyAdmin will not honor my request and re-specifies the current auto_increment value in the ALTER TABLE command (even though my requested value is valid). Is this because of a config setting? I could have sworn earlier versions would obey my request. Chuck: This always works for me in PhpMyAdmin (I mistyped it before). 1. Delete the first record. 2. Reset the auto_increment in Operations to whatever you want. 3. Insert a record. 4. Delete that record. After that, the next record will start at the new auto_increment value. Don't ask why, that's just the way it works. tedd That would work, except that I want to change the auto_increment without deleting the first record. During testing I may add many entries to the end of an existing database table. When I am done testing I want to delete those extraneous entries (leaving the earlier entries intact). Call me obsessive/compulsive or whatever, but I like to knock the auto_increment value back down to the next valid value (what was the first test value). PhpMyAdmin refuses to use the valid auto_increment value I specify in Operations and I have to edit the query to set it right. Chuck: Okay, then delete whatever record you want and reset the auto_increment value to that -- for example: Let's say you have records 0 - 100 that you want to keep. Then you added some test records that went from 101 to 150 and now you want to delete those records and start again at 101, right? Simple, just: 1. Delete records 101-150. 2. Reset the auto_increment in Operations to 101 3. Insert a false record. 4. Delete that false record. Now, your dB will be set to start at 101. What's even more amazing (at least I've found), is that if you had 0-100 records you wanted to keep and 101-150 you wanted to delete, but also had 151 to 200 you also wanted to keep, you could do what I said above and the auto_increment would fill up 101-150 and then jump to 201. It's neat the way it works. At least that's my memory. Try it. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0
tedd wrote: At 3:01 PM -0600 4/16/06, Chuck Anderson wrote: tedd wrote: At 1:42 PM -0600 4/16/06, Chuck Anderson wrote: alex wrote: hi everyone i have delete a few entries in my database as they were entered for testing purposes and are no longer need (actually 102 entries)... and even thought that db is empty i noticed that when the next entry went in the id number went to 103 not 0 so i was wondering is it possible to somehow reset the value to zero... it is of int type and auto_increment i have a few db's which id like to reset to zero i have tried placing a zero enrty after deleting the lot but it only jumps to its next increment. does anyone know what i mean...? any help will be grateful regards alex On a related note (he did say PhpMyAdmin) ... ALTER TABLE 'tablename' auto_increment=n works, but I can't get PhpMyAdmin to reset the auto_increment through the Operations menu page. If I go to the Operations tab for a table and set the auto_increment value to something less that it currently is, PhpMyAdmin will not honor my request and re-specifies the current auto_increment value in the ALTER TABLE command (even though my requested value is valid). Is this because of a config setting? I could have sworn earlier versions would obey my request. Chuck: This always works for me in PhpMyAdmin (I mistyped it before). 1. Delete the first record. 2. Reset the auto_increment in Operations to whatever you want. 3. Insert a record. 4. Delete that record. After that, the next record will start at the new auto_increment value. Don't ask why, that's just the way it works. tedd That would work, except that I want to change the auto_increment without deleting the first record. During testing I may add many entries to the end of an existing database table. When I am done testing I want to delete those extraneous entries (leaving the earlier entries intact). Call me obsessive/compulsive or whatever, but I like to knock the auto_increment value back down to the next valid value (what was the first test value). PhpMyAdmin refuses to use the valid auto_increment value I specify in Operations and I have to edit the query to set it right. Chuck: Okay, then delete whatever record you want and reset the auto_increment value to that -- for example: Let's say you have records 0 - 100 that you want to keep. Then you added some test records that went from 101 to 150 and now you want to delete those records and start again at 101, right? Simple, just: 1. Delete records 101-150. 2. Reset the auto_increment in Operations to 101 3. Insert a false record. 4. Delete that false record. Now, your dB will be set to start at 101. What's even more amazing (at least I've found), is that if you had 0-100 records you wanted to keep and 101-150 you wanted to delete, but also had 151 to 200 you also wanted to keep, you could do what I said above and the auto_increment would fill up 101-150 and then jump to 201. It's neat the way it works. At least that's my memory. Try it. tedd I appreciate your help here . but 2. Reset the auto_increment in Operations to 101 That's the part that PhpMyAdmin refuses to do. It will not alter it to less than 151 (per your example). PhpMyAdmin 2.6.4-pl3 It's not much work to then edit the PhpMyAdmin query to my liking, but I don't think I used to have to do that. I like your second part about filling in the between stuff. If I'm at that point, though, I delete the auto_increment field (sorting the table by date) and then add it back in. That fills all the gaps, too. What I want to know is why PhpMyAdmin will not do your step 2. I swear that earlier versions would let me do that. -- * Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New Date/Time Functionality and Setting Timezones
In more than one place in the PHP documentation it refers to the order in which the new Date/Time functionality determines the appropriate time zone. That order is: 1) the value set by date_default_timezone_set(), if any 2) the TZ environmental variable 3) the date.timezone php.ini option 4) magical guess 5) UTC Is this indeed the actual order? Would it not make more sense to prioritize the date.timezone php.ini setting over the TZ environmental variable? That way users who don't have control over their TZ environmental variable (such as might be the case with some shared hosting environments) could set the timezone in an htaccess file rather than having to ensure they call date_timezone_default_set() in every script. Chris [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: phpMyAdmin--resetting auto increments to 0
[snip] 2. Reset the auto_increment in Operations to 101 [/snip] This isn't another of those 'reseting the auto-increment' holy war questions where you use the AI number as an identifier for the record, is it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Table formation...
I know that this is simple, and again I am operating on little rest in the quest to get a site launch by sometime tomorrow evening. I have a table of data and I want to display items by two's, i.e. Item 1 Item 2 Item 3 Item 4 Item 5 ...and so on. I seem to remember doing this using mod to calculate if I had divided by 2. I am still searching for info, but I am missing it somehow. Does anyone know where I can find an example of this or a code snippet? Thanks truckloads! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Table formation...
On 4/17/06, Jay Blanchard [EMAIL PROTECTED] wrote: I know that this is simple, and again I am operating on little rest in the quest to get a site launch by sometime tomorrow evening. I have a table of data and I want to display items by two's, i.e. Item 1 Item 2 Item 3 Item 4 Item 5 ...and so on. I seem to remember doing this using mod to calculate if I had divided by 2. I am still searching for info, but I am missing it somehow. Does anyone know where I can find an example of this or a code snippet? Thanks truckloads! Something like this? $c = 0; while($c $itemcount) { if ($c % 2 == 0) $c++; } -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Table formation...
[snip] Something like this? $c = 0; while($c $itemcount) { if ($c % 2 == 0) $c++; } [/snip] Yep! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0
Jay Blanchard wrote: [snip] 2. Reset the auto_increment in Operations to 101 [/snip] This isn't another of those 'reseting the auto-increment' holy war questions where you use the AI number as an identifier for the record, is it? Nope. And I have no intention of taking it there. I just get obsessive and thorough when testing and then I don't like stale data in my database - so I like to reset everything. It would be better to backup before testing and then restore. Resetting the AI just makes it the same as if you had. And my real question is about PhpMyAdmin and why it no longer seems to let you reset the AI using the Operations page. At least it doesn't on my machine - Windows XP - Apache/2.0.55 - PhpMyAdmin 2.6.4-pl3. -- * Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: phpMyAdmin--resetting auto increments to 0
[snip] I just get obsessive and thorough when testing and then I don't like stale data in my database - so I like to reset everything. It would be better to backup before testing and then restore. Resetting the AI just makes it the same as if you had. [/snip] I agree, that is why I truncate the tables after testing, if I am testing on the production box. [snip] And my real question is about PhpMyAdmin and why it no longer seems to let you reset the AI using the Operations page. At least it doesn't on my machine - Windows XP - Apache/2.0.55 - PhpMyAdmin 2.6.4-pl3. [/snip] Hmmmdoesn't phpMyAdmin have a list or bug report? I know that a bunch of us use it here...but this may be specific enough for the more specific lists. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Framework alternative ...
I second that, and if anyone in the know cares to comment on whether: a. php will actually implement static late binding Mike Lively gives and update on the late static binding patch submitted to the internals on his blog http://www.digitalsandwich.com/archives/53-Late-Static-Binding-in-PHP.html -- life is a game... so have fun. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Table formation...
At 05:19 PM 4/16/2006, Jay Blanchard wrote: I have a table of data and I want to display items by two's, i.e. Item 1 Item 2 Item 3 Item 4 Item 5 Pardon my asking on the eve of your launch, but is a table the most sensible markup for this data? It looks to me like a one-dimensional list that just happens to be presented two to a row. If so, I'd use an unordered list, float each item left, and limit the list width to two item widths. Regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Table formation...
[snip] Pardon my asking on the eve of your launch, but is a table the most sensible markup for this data? It looks to me like a one-dimensional list that just happens to be presented two to a row. If so, I'd use an unordered list, float each item left, and limit the list width to two item widths. [/snip] Thanks, but I just used what I showed as an example. It is a table products including pictures, features, etc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php