Re: [PHP-DB] New users on mysql using php
On Friday 26 October 2001 05:29 am, Harpreet wrote: > I do have root access and run the Grant command in Telnet. > > But what i want to do is have a web page called add_user.php. When > the administartor adds a username and password i want that user to be > granted all rights. I eman can i run the Grant statement in my php > page and not on Telnet. All the grants and access info are stored in the "mysql" database. You can manipulate it directly to grant whatever you want. For the details look in the manual. regards -- Jason Wong Gremlins Associates www.gremlins.com.hk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Help, need the scripts of processing the to-be-confirmed email.
// Question 1: // How to process the confirmation email by clicking the url // given in the email // and by replying the email. when you send them an email, include some sort of confirmation code ie http://server/confirm.php?confirmCode=xxx when they click, it passes this code, and you look it up in the database or something and match it against an account, which then becomes verified. you should also have the option of them hitting the same page without that var defined, and let them enter it themselves, so that if the URL is broken in their email client they can still enter the code you give to them and get in ;) // Question 2: // I know if using mail(), the "From" field of the mail sent // out is always the // web host server's mail sendout server, // not from my own email box. How to send out the email which looks like // sending out from my own email box. RTFM failing that, add a header // Question 3: // How to let MYSQL automatically delete the unactivated signups? maybe a cron job to hit a script? (use either lynx to page or execute the cgi verison of php) on that script look for a "date_created" field or something, and if "now minus date_created greater than tolerance" then delete that entry then you can set tolerance to be an hour, 2 days, whatever enjoy and probably consider thinking about things a bit more before just shooting off a question to us to solve your problems /b -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Help, need the scripts of processing the to-be-confirmed email.
I need some help about example scripts on: Question 1: How to process the confirmation email by clicking the url given in the email and by replying the email. Question 2: I know if using mail(), the "From" field of the mail sent out is always the web host server's mail sendout server, not from my own email box. How to send out the email which looks like sending out from my own email box. Question 3: How to let MYSQL automatically delete the unactivated signups? Thanks! Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] HELP! (mysql)
if you have phpMyAdmin then just use that (if you don't then you *really* should :) otherwise, yeah just use mysql_query() or use the command line of course the second 2 options assume you can construct the SQL command to do it, using phpMyAdmin you won't really need to know. /beau // -Original Message- // From: Duncan Abbott [mailto:[EMAIL PROTECTED]] // Sent: Friday, 26 October 2001 9:17 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] HELP! (mysql) // // // hello, // // can one of you clever people guys 30 seconds to help a lady...? // // can someone just tell me the best way to create a new table // in a mysql // database? // should i use the mysql_query() function? // // thank you boys, // // xxx // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] HELP! (mysql)
hello, can one of you clever people guys 30 seconds to help a lady...? can someone just tell me the best way to create a new table in a mysql database? should i use the mysql_query() function? thank you boys, xxx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Metabase fully supports BLOBs (files in the databases) now!
Hello, After many weeks of development, and despite the lack of free time mostly due to the birth of my son, it was released a new version of Metabase - the PHP abstraction to develop database independent applications. The main new feature is the full support to the creation and access to table fields of type BLOB (Binary Large OBject) that as you know serves the purpose of storing large ammounts of data that usually is stored in files. This capacity is implemented in a fully portable way, which is the style of Metabase, that works seeminglessly with all supported databases: MySQL, PostgreSQL, MS SQL , Oracle, Informix, Interbase and ODBC. The main manual and tutorial documents were updated to teach you on how to use this new capacity. Another change is the distribution license that is now fully compliant on the BSD style license which is officially approved as an Open Source license. From now on it is clear that Metabase may be freely used and distributed, including within Linux distributions and applications, including commercial ones. Metabase may be freely downloaded from this site as usual. http://phpclasses.UpperDesign.com/browse.html/package/20 For those that would like to meet me and live near Germany, I will be attending the PHP Conference. Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: importing BLOBs from MSSQL
Hello, M0sh3 wrote: > > Hi, i'm trying to import tables containing TEXT fields from MSSQL 2K, so far > tried different ways, one of them DTS, but unsuccessfully. > > It gives error: "Query-based insertion or updating of BLOB values is not > supported." Try Metabase that fully supports BLOBs in many databases including MSSQL. Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] New users on mysql using php
I do have root access and run the Grant command in Telnet. But what i want to do is have a web page called add_user.php. When the administartor adds a username and password i want that user to be granted all rights. I eman can i run the Grant statement in my php page and not on Telnet. Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 4:57 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] New users on mysql using php Do you have root access to mysql? If so, then you can GRANT privileges to create new users. Otherwise, you have only the GRANT privileges delegated to you by the MySQL admin. -Original Message- From: Harpreet [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 4:03 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] New users on mysql using php I connect to mysql database using the following: $StrConnectionUser=mysql_connect(ipaddress,"$USER"); mysql_select_db(database name, $StrConnectionUser); My question is how can I add new users to mysql using the web interface. Like can i run the Grant and revoke (mysql commands) in my php page?? This way i can add or delete users that can have access to the mysql database through the web. I hope the above makes sense. Thanks, Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] New users on mysql using php
go grab yourself a copy of phpmyadmin http://phpmyadmin.sourceforge.net/download.html jim - Original Message - From: "Harpreet" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 25, 2001 2:02 PM Subject: [PHP-DB] New users on mysql using php > I connect to mysql database using the following: > > $StrConnectionUser=mysql_connect(ipaddress,"$USER"); > mysql_select_db(database name, $StrConnectionUser); > > My question is how can I add new users to mysql using the web interface. > Like can i run the Grant and revoke (mysql commands) in my php page?? > > This way i can add or delete users that can have access to the mysql > database through the web. > I hope the above makes sense. > > Thanks, > Regards, > Harpreet Kaur > Software Developer > Crispin Corporations Inc. > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] New users on mysql using php
Do you have root access to mysql? If so, then you can GRANT privileges to create new users. Otherwise, you have only the GRANT privileges delegated to you by the MySQL admin. -Original Message- From: Harpreet [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 4:03 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] New users on mysql using php I connect to mysql database using the following: $StrConnectionUser=mysql_connect(ipaddress,"$USER"); mysql_select_db(database name, $StrConnectionUser); My question is how can I add new users to mysql using the web interface. Like can i run the Grant and revoke (mysql commands) in my php page?? This way i can add or delete users that can have access to the mysql database through the web. I hope the above makes sense. Thanks, Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] New users on mysql using php
I connect to mysql database using the following: $StrConnectionUser=mysql_connect(ipaddress,"$USER"); mysql_select_db(database name, $StrConnectionUser); My question is how can I add new users to mysql using the web interface. Like can i run the Grant and revoke (mysql commands) in my php page?? This way i can add or delete users that can have access to the mysql database through the web. I hope the above makes sense. Thanks, Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] import error into mySQL
Show your code and table set-up. That would help. -Original Message- From: Dave Pollak [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 1:37 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] import error into mySQL Howdy, New to databases, mySQL, and PHP. In my first PHP/mySQL application I'm loading data from a flat file exported from a Paradox database. Dates in one field import as -00-00 though they import properly in other fields. They appear to be configured alike - dob DATE & date_reg DATE - and the data in the text file is correct. Loaded data from local infile declaring delimiter as ',' and field enclosure as '"' (double quote). Also have run some select queries where field_name is null that do not return any rows yet visual examination of fields after select * query shows no data. Thoughts? Dave Pollak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] import error into mySQL
Howdy, New to databases, mySQL, and PHP. In my first PHP/mySQL application I'm loading data from a flat file exported from a Paradox database. Dates in one field import as -00-00 though they import properly in other fields. They appear to be configured alike - dob DATE & date_reg DATE - and the data in the text file is correct. Loaded data from local infile declaring delimiter as ',' and field enclosure as '"' (double quote). Also have run some select queries where field_name is null that do not return any rows yet visual examination of fields after select * query shows no data. Thoughts? Dave Pollak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Recurse thru dir into DB
I would suggest perhaps a different way (slightly larger use of disk space, but only one script and only one query, although a moderately complex query): 1) Subscriber's emails are stored in table 'A' with their associated category as a data field. 2) A unix_timestamp field is added to table 'A'. The value of this field initially = when the user subscribed. 3) Once daily, a script: a) loads the contents of each directory into a table (B, C, D, etc.). b) compares the create dates of each file with the unix_timestamp in the subscriber tables, SELECTing email addresses where the unix_timestamp < the create date of the files, by category (all in one SELECT statement?) c) mail()s those users d) updates the unix_timestamp in table A, and start the cycle anew. e) nuke the temporary tables of directory contents (or retain for further programming) All really depends on what you're optimizing for...this is perhaps the easiest implementation for me in terms of programming, but is probably not the easiest method on the server. Cheers, Dan Russ Michell wrote: > Hi there folks, this problem is sincerely 'doing my head in'! > I want to know if there is a simpler method of achieving my aims set out below: > > Script aim: > > * To alert users subscribed to category's when new files are added to that category. > * A category has the same name as each directory in my projects' filesystem. > > Proposed method (this is what I need a hand with) > > * Subscribers emails are stored in table 'A' under their associated category. (Each >column name > reflects a category name) > * Subscribers are auto-emailed whenever a new file is added to their category > * A script is executed by cron that iterates through all categories at time 'X, once >every morning. > * The script gets current file numbers per directory and places this data into table >'B'. > * Another script, also executed by cron every evening at time 'Y' (after the script >above), > compares the value of files per directory from table 'B' to the *now* current number >of files in > each directory. > * It inserts these values into a another table 'C' and compares the totals in 'B' >and 'C'. > * If the totals in 'C' are greater than those in 'B' then detect which category's >have had files > added and select emails from table 'A' where their subscribed categories = updated >categories. > * mail() these addresses with the message "Directory X has been updated" > > Is this too contrived or is there an easier method? I already have various directory >recursion > scripts I got from phpbuilder, but the exact method of performing the above kinda >eludes me. > > Any (constructive) comments more than welcome. > > Kind regards: > Russ > > #---# > > "Believe nothing - consider everything" > > Russ Michell > Anglia Polytechnic University Webteam > Room 1C 'The Eastings' East Road, Cambridge > > e: [EMAIL PROTECTED] > w: www.apu.ac.uk/webteam > > www.theruss.com > > #---# > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- -- Dan Barton Terrestrial Program Biologist Data Manager Point Reyes Bird Observatory http://www.prbo.org [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
> From: Chris Newbill [mailto:[EMAIL PROTECTED]] > >snip... (been doing VBScript on ASP for several years, tho). > > I feel sorry for you. :) ;) Never fear. It works, does what it needs to do (so long as it's properly patched ;) and I make a fist-full of money for moon-lighting. Can't complain too loudly, eh? > >If you're going to store it as an integer, why not store "10/24/2001" > >as MMDD > A better way to do integer date is a UNIX timestamp. This will sort just as > easy as the method above. > > By looking at the date() function you should be able to see immediately the > benefit in ease-of-use (not to mention portability in the DB) and formating > options available for the timestamp. > > http://www.php.net/date > > -Chris Don't get me wrong.. I'm quite comfortable with manipulating dates (well.. as far as M$ goes), and I fully intend to continue using DATE fields and functions to handle my date needs. I'm too lazy to re-invent the wheel. The crux of my question was aimed only at those who didn't want to use DATE fields and would rather use int fields instead. I wanted to make sure I wasn't missing some cool feature of PHP. ..and the feedback I'm getting indicates that my general understanding of dates in ASP is not too different with PHP. TIM -Things are more like they are today than they ever have been before. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
-Original Message- From: Tim Foster [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:19 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries... >snip... (been doing VBScript on ASP for several years, >tho). I feel sorry for you. :) >I'm curious... > >If you're going to store it as an integer, why not store "10/24/2001" as MMDD >(20011024). This gives you the added benefit of being able to have the db sort your >fields. This even works if you want to include the time with your date (provided all dates >in the field consistently contain the same *amount* of info). For example, noon on >Christmas will always be lower than noon of the following New Year ..as it should be: > >/MM/DD 20011225< 20020101 >/MM/DD HH:MM 200112251200< 200201011200 >/MM/DD HH:MM:SS2001122512 < 2002010112 A better way to do integer date is a UNIX timestamp. This will sort just as easy as the method above. By looking at the date() function you should be able to see immediately the benefit in ease-of-use (not to mention portability in the DB) and formating options available for the timestamp. http://www.php.net/date -Chris >> -Original Message- >> From: Mike Frazer [mailto:[EMAIL PROTECTED]] >> Sent: Wednesday, October 24, 2001 7:54 AM >> To: [EMAIL PROTECTED]; [EMAIL PROTECTED] >> Subject: Re: [PHP-DB] PHP and MySQL queries... >> >> >> Agreed. This is especially useful when you need to conserve every byte you >> can; a timestamp of "10/24/2001" or something similar is going to take 10 >> bytes as a string and an indeterminate number of bytes for an actual >> timestamp because of system variations, whereas an integer value of 10242001 >> will take you 2-4 bytes depending on the type of int you declare. Not a lot >> of space, but assume for a second you have 30 fields in your database and 5 >> million rows...suddenly those 6-8 bytes have multiplied on this one field >> alone. Space and speed are important in DBs :) >> >> Mike Frazer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Help!!!!!! ¡¡¡¡¡¡¡Ayuda!!!!!!
Look for extensions in the file php.ini. uncomment the line: extension=php_dbase.so (for linux or) extension=php_dbase.dll (for windows) remember to set extension_dir to directory where you have the file. Hope it helps. Bruno Gimenes Pereti. > I need to open a dbase file, so I use the "dbase_open" function and then I > compile it but it tells me > > Fatal error: Call to undefined function: dbase_open() > > it seems like this function does not exists!.Does anybody could help me? > Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PROBLEM ACCESSING DBASE WITH PHP
You only need to post your question once, and you really shouldn't cross-post to multiple lists...please, I just got six copies of your question. Did you compile php with the --enable-dbase configure flag? You can check with phpinfo() for what's enabled and also what configuration flags were used. -Steve On Thursday, October 25, 2001, at 12:31 PM, Sebas wrote: > I need to open a dbase file, so I use the "dbase_open" function and > then I > compile it but it tells me > > Fatal error: Call to undefined function: dbase_open() > > it seems like this function does not exists!.Does anybody could help me? > Thanks > [EMAIL PROTECTED] > > > --- > Necesito abrir una base de datos dbase, por lo que uso la funciÛn > "dbase_open" y al compilar, me sale el error: > > Fatal error: Call to undefined function: dbase_open() > > Parece como si la funciÛn no existiera. øøPuede alguien ayudarme?? °°Es > muy > urgente!!Gracias > > [EMAIL PROTECTED] > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PROBLEM ACCESSING DBASE WITH PHP
I need to open a dbase file, so I use the "dbase_open" function and then I compile it but it tells me Fatal error: Call to undefined function: dbase_open() it seems like this function does not exists!.Does anybody could help me? Thanks [EMAIL PROTECTED] --- Necesito abrir una base de datos dbase, por lo que uso la función "dbase_open" y al compilar, me sale el error: Fatal error: Call to undefined function: dbase_open() Parece como si la función no existiera. ¿¿Puede alguien ayudarme?? ¡¡Es muy urgente!!Gracias [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] sebas
I need to open a dbase file, so I use the "dbase_open" function and then I compile it but it tells me Fatal error: Call to undefined function: dbase_open() it seems like this function does not exists!.Does anybody could help me? Thanks [EMAIL PROTECTED] --- Necesito abrir una base de datos dbase, por lo que uso la función "dbase_open" y al compilar, me sale el error: Fatal error: Call to undefined function: dbase_open() Parece como si la función no existiera. ¿¿Puede alguien ayudarme?? ¡¡Es muy urgente!!Gracias [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Help!!!!!! ¡¡¡¡¡¡¡Ayuda!!!!!!
I need to open a dbase file, so I use the "dbase_open" function and then I compile it but it tells me Fatal error: Call to undefined function: dbase_open() it seems like this function does not exists!.Does anybody could help me? Thanks --- Necesito abrir una base de datos dbase, por lo que uso la función "dbase_open" y al compilar, me sale el error: Fatal error: Call to undefined function: dbase_open() Parece como si la función no existiera. ¿¿Puede alguien ayudarme?? ¡¡Es muy urgente!!Gracias -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...Agreed. Personally, I refuse to keep date values in fields that are not DATE fields of some kind. Too much trouble. TIM -How do "Do Not Walk On Grass" signs get there? -Original Message- From: Robinson, Mike [mailto:[EMAIL PROTECTED]] Mysql permits all manner of formats for date/time storage, and a whole slew of functions for retrieving date/time info in useful, meaningful ways. For me, parsing date/time stuff before an insert or after a select is just plain bad practice, IMHO, when the data can go in and out in the format required without parsing, particularly with resource-costly tools like regex and the like.
RE: [PHP-DB] executing system commands
Try to avoid system commands whenever you can and instead use PHP functions when they're available. In this case, you can use the following function mkdir: http://www.php.net/manual/en/function.mkdir.php What is the problem you're having with that system command? The most frequent problems stem from lack of permissions in a directory that you're trying to manipulate. i.e. You try to add a file to a directory, but it gets rejected mysteriously - the most likely cause is that the directory is owned by someone else and you don't have write permissions. The other frequent problem stems from not defining the path to a command, i.e. system("mycommand"); instead of system("/usr/bin/mycommand"); Hope this helps if you're having problems. - Jonathan -Original Message- From: Ric Manalac [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 3:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] executing system commands hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = "mkdir /home/httpd/html/miroku/downloads/$directory"; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries...
Title: RE: [PHP-DEV] RE: [PHP-DB] PHP and MySQL queries... http://mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_types Mysql permits all manner of formats for date/time storage, and a whole slew of functions for retrieving date/time info in useful, meaningful ways. For me, parsing date/time stuff before an insert or after a select is just plain bad practice, IMHO, when the data can go in and out in the format required without parsing, particularly with resource-costly tools like regex and the like. Date/time select controls (I think there's some on devshed and/or Zend) and mysql's built-in date/time functions rock. Mike Robinson IT / Developer - Toronto Star TV Phone: 416.945.8786 Fax: 416.869.4566 Email: [EMAIL PROTECTED] Tim Foster wrote: > If there's something about PHP/MySQL that makes this point > moot, please let me know. http://www.torontostartv.com - Webcasting & Production http://www.tmgtv.ca - Hometown Television http://www.thestar.com - Canadas largest daily newspaper, The Toronto Star, online -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP and MySQL queries...
Oop. I guess I missed the point of that question. Still, the MySQL manual says a DATE takes 3 bytes, DATETIME 8 bytes, and TIMESTAMP 4 bytes. That seems fairly efficient. Using an INT for a date might actually take up more space. -Steve On Thursday, October 25, 2001, at 09:34 AM, Steve Cayford wrote: > Yep, MySQL has DATE, DATETIME, and TIMESTAMP field types. You can order > by them and everything. > > -Steve > > On Thursday, October 25, 2001, at 09:18 AM, Tim Foster wrote: > >> I'm new to this list, to PHP and to MySQL (been doing VBScript on ASP >> for several years, >> tho). >> >> I'm curious... >> >> If you're going to store it as an integer, why not store "10/24/2001" >> as MMDD >> (20011024). This gives you the added benefit of being able to have the >> db sort your >> fields. This even works if you want to include the time with your date >> (provided all dates >> in the field consistently contain the same *amount* of info). For >> example, noon on >> Christmas will always be lower than noon of the following New Year >> ..as it should be: >> >> /MM/DD 20011225< 20020101 >> /MM/DD HH:MM 200112251200< 200201011200 >> /MM/DD HH:MM:SS 2001122512 < 2002010112 >> >> I'm betting there's no easy way to sort it if you store it as MM/DD/YY >> >> MM/DD/ 10242001 < 12252001 (good) >> ..but NOT less than the following New Year's >> MM/DD/ 10242001 > 01012002 (bad) >> >> Granted, you might take up a bit more space in the DB, which would >> have a tiny impact on >> performance(??), but an extra $100 on the hard drive would effectively >> eliminate any >> reasonable space considerations and (IMHO) reduce the amount of >> programming/debugging to >> more than justify the overhead. >> >> FWIW, M$ likes to store their dates as two integers: one to hold the >> date portion, the >> other to hold the hours:minutes:seconds portion. >> >> If there's something about PHP/MySQL that makes this point moot, >> please let me know. >> >> TIM >> -He who always plows a straight furrow is in a rut. >> >> >>> -Original Message- >>> From: Mike Frazer [mailto:[EMAIL PROTECTED]] >>> Sent: Wednesday, October 24, 2001 7:54 AM >>> To: [EMAIL PROTECTED]; [EMAIL PROTECTED] >>> Subject: Re: [PHP-DB] PHP and MySQL queries... >>> >>> >>> Agreed. This is especially useful when you need to conserve every >>> byte you >>> can; a timestamp of "10/24/2001" or something similar is going to >>> take 10 >>> bytes as a string and an indeterminate number of bytes for an actual >>> timestamp because of system variations, whereas an integer value of >>> 10242001 >>> will take you 2-4 bytes depending on the type of int you declare. >>> Not a lot >>> of space, but assume for a second you have 30 fields in your database >>> and 5 >>> million rows...suddenly those 6-8 bytes have multiplied on this one >>> field >>> alone. Space and speed are important in DBs :) >>> >>> Mike Frazer >> >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >> [EMAIL PROTECTED] >> > > > -- PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP and MySQL queries...
Yep, MySQL has DATE, DATETIME, and TIMESTAMP field types. You can order by them and everything. -Steve On Thursday, October 25, 2001, at 09:18 AM, Tim Foster wrote: > I'm new to this list, to PHP and to MySQL (been doing VBScript on ASP > for several years, > tho). > > I'm curious... > > If you're going to store it as an integer, why not store "10/24/2001" > as MMDD > (20011024). This gives you the added benefit of being able to have the > db sort your > fields. This even works if you want to include the time with your date > (provided all dates > in the field consistently contain the same *amount* of info). For > example, noon on > Christmas will always be lower than noon of the following New Year ..as > it should be: > > /MM/DD20011225< 20020101 > /MM/DD HH:MM 200112251200< 200201011200 > /MM/DD HH:MM:SS 2001122512 < 2002010112 > > I'm betting there's no easy way to sort it if you store it as MM/DD/YY > > MM/DD/10242001 < 12252001 (good) > ..but NOT less than the following New Year's > MM/DD/10242001 > 01012002 (bad) > > Granted, you might take up a bit more space in the DB, which would have > a tiny impact on > performance(??), but an extra $100 on the hard drive would effectively > eliminate any > reasonable space considerations and (IMHO) reduce the amount of > programming/debugging to > more than justify the overhead. > > FWIW, M$ likes to store their dates as two integers: one to hold the > date portion, the > other to hold the hours:minutes:seconds portion. > > If there's something about PHP/MySQL that makes this point moot, please > let me know. > > TIM > -He who always plows a straight furrow is in a rut. > > >> -Original Message- >> From: Mike Frazer [mailto:[EMAIL PROTECTED]] >> Sent: Wednesday, October 24, 2001 7:54 AM >> To: [EMAIL PROTECTED]; [EMAIL PROTECTED] >> Subject: Re: [PHP-DB] PHP and MySQL queries... >> >> >> Agreed. This is especially useful when you need to conserve every >> byte you >> can; a timestamp of "10/24/2001" or something similar is going to take >> 10 >> bytes as a string and an indeterminate number of bytes for an actual >> timestamp because of system variations, whereas an integer value of >> 10242001 >> will take you 2-4 bytes depending on the type of int you declare. Not >> a lot >> of space, but assume for a second you have 30 fields in your database >> and 5 >> million rows...suddenly those 6-8 bytes have multiplied on this one >> field >> alone. Space and speed are important in DBs :) >> >> Mike Frazer > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] PHP and MySQL queries...
I'm new to this list, to PHP and to MySQL (been doing VBScript on ASP for several years, tho). I'm curious... If you're going to store it as an integer, why not store "10/24/2001" as MMDD (20011024). This gives you the added benefit of being able to have the db sort your fields. This even works if you want to include the time with your date (provided all dates in the field consistently contain the same *amount* of info). For example, noon on Christmas will always be lower than noon of the following New Year ..as it should be: /MM/DD 20011225< 20020101 /MM/DD HH:MM200112251200< 200201011200 /MM/DD HH:MM:SS 2001122512 < 2002010112 I'm betting there's no easy way to sort it if you store it as MM/DD/YY MM/DD/ 10242001 < 12252001 (good) ..but NOT less than the following New Year's MM/DD/ 10242001 > 01012002 (bad) Granted, you might take up a bit more space in the DB, which would have a tiny impact on performance(??), but an extra $100 on the hard drive would effectively eliminate any reasonable space considerations and (IMHO) reduce the amount of programming/debugging to more than justify the overhead. FWIW, M$ likes to store their dates as two integers: one to hold the date portion, the other to hold the hours:minutes:seconds portion. If there's something about PHP/MySQL that makes this point moot, please let me know. TIM -He who always plows a straight furrow is in a rut. > -Original Message- > From: Mike Frazer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 24, 2001 7:54 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP-DB] PHP and MySQL queries... > > > Agreed. This is especially useful when you need to conserve every byte you > can; a timestamp of "10/24/2001" or something similar is going to take 10 > bytes as a string and an indeterminate number of bytes for an actual > timestamp because of system variations, whereas an integer value of 10242001 > will take you 2-4 bytes depending on the type of int you declare. Not a lot > of space, but assume for a second you have 30 fields in your database and 5 > million rows...suddenly those 6-8 bytes have multiplied on this one field > alone. Space and speed are important in DBs :) > > Mike Frazer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mySQL Query and blank fields
On Thursday 25 October 2001 15:08, Rick Emery wrote: > First, I wouldn't use length(), I'd use REGEXP: SELECT * FROM > foo_table WHERE fieldname REGEXP '..+' > It's quicker. regular expression is faster then a length() call? that's seems strange considering how complex a regexp can be with regexp, it takes 0.13sec on a simple table with lenght it is 0.08sec. Arpi -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Recurse thru dir into DB
Hi there folks, this problem is sincerely 'doing my head in'! I want to know if there is a simpler method of achieving my aims set out below: Script aim: * To alert users subscribed to category's when new files are added to that category. * A category has the same name as each directory in my projects' filesystem. Proposed method (this is what I need a hand with) * Subscribers emails are stored in table 'A' under their associated category. (Each column name reflects a category name) * Subscribers are auto-emailed whenever a new file is added to their category * A script is executed by cron that iterates through all categories at time 'X, once every morning. * The script gets current file numbers per directory and places this data into table 'B'. * Another script, also executed by cron every evening at time 'Y' (after the script above), compares the value of files per directory from table 'B' to the *now* current number of files in each directory. * It inserts these values into a another table 'C' and compares the totals in 'B' and 'C'. * If the totals in 'C' are greater than those in 'B' then detect which category's have had files added and select emails from table 'A' where their subscribed categories = updated categories. * mail() these addresses with the message "Directory X has been updated" Is this too contrived or is there an easier method? I already have various directory recursion scripts I got from phpbuilder, but the exact method of performing the above kinda eludes me. Any (constructive) comments more than welcome. Kind regards: Russ #---# "Believe nothing - consider everything" Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w: www.apu.ac.uk/webteam www.theruss.com #---# -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] mySQL Query and blank fields
Try: UPDATE mytable SET myfield=CONCAT( LEFT(myfield,LENGTH(myfield)-1),'new_string') WHERE some_condition If you know the field will ALWAYS be the same length (for instance 5, and you wish to replace the 5th character): UPDATE mytable SET myfield=CONCAT(LEFT(myfield,4),'new_char') WHERE some_condition -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:37 AM To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields I'd like to do it in mySQL, I think it will be done much quicker since it a large database. The type of the field is allready varchar. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 16:08 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields First, I wouldn't use length(), I'd use REGEXP: SELECT * FROM foo_table WHERE fieldname REGEXP '..+' It's quicker. As far as the second question, do you wish to do it in PHP or MySQL? Does the value in MySQL require other computations (so, it must remain numeric) or can it be a CHAR string? -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:04 AM To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Thanks a lot! I quite didn't know what to look for in the manual. I actually have another question: If I want to update several fields, add a number to the end of the fields value, how do I do that? I have field with value '9876' and if I do "...field=field+'5'..." the value turns into '9881' not '98765' as I expected. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 15:56 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Change that to: SELECT * FROM foo_table WHERE length(bar_field)>1; -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:01 AM To: Niklas Lampén; Php-DB Subject: Re: [PHP-DB] mySQL Query and blank fields On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] HTML form not dealing with required fields correctly
Hi all! I must not be seeing something here. I have a form where some of the fields are optional and some are required, however when you click submit, the form will only continue to the next page if ALL fields are completed, but the data is entered into the database just fine in all instances. I have looked at this all night and am just not seeing the issue. The scripted was generated my MacSQL 2.0.1 if that helps. Any and all ideas on what I am doing wrong would be greatly appreciated. System... OS; Mac OSX 10.0.4 PHP: 4.0.6 mySQL: 3.23.32 Apache: 1.3.14 my brain: back in beta Storm Williams 0) $stmt .= ','; $stmt .= "'" . AddSlashes($val) . "'"; } $stmt .= ')'; if (!mysql_query($stmt)) $err++; if ($err) $thanksUrl = $errUrl; header("Location: $thanksUrl"); exit; } ?> http://www.rtlabs.com/macsql/>) and is copyright 2001 Runtime Labs, Inc. Registered users of MacSQL Monitor are granted unlimited right to use this code on websites they build. This notice must be included with this code. This code is provided AS IS with no warranty of any kind. */ function isInteger($val) { return preg_match("/^\d+$/", $val); } function isAlphaNum($val) { return preg_match("/^\w+$/", $val); } function hasNonAlphaNum($val) { return preg_match("/\W/", $val); } function isCCExpDate($val) { $d = preg_split("/\//", $val); if (strlen($d[1]) < 3) $d[1] += 2000; return (($d[0] > 0) && ($d[0] <= 12) && ($d[1] > 2000) && ($d[1] < 2050)); } function isDate($val) { return preg_match("#\d\d?[-/]\d\d?[-/]\d{2,4}#", $val); } ?> sign YOUR band sign YOUR band All fields in RED are required. PLA Version 1.0 Gobs or text goes here. Agree? Band Name Contact Info Genre Alternative Blues Celtic Classical Country Electronica Experimental Folk & Traditional Industrial Jazz Latin Metal New Age Rap & Hip Hop Religious Rock Ska Soul + R&B Spoken Word World First Name Last Name Address 1 Address 2 City State/Province ZIP/Postal Code Country Select One Canada France Germany Italy Japan Russia United Kingdom United States - - - - Afghanistan Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua And Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas, The Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean Terr. Brunei Bulgaria Burkina Faso Burundi Cambodia Cameroon Cape Verde Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Congo, Dem. Rep Cook Islands Costa Rica Cote D'Ivoire (Ivory Coast) Croatia (Hrvatska) Cuba Cyprus Czech Republic Denmark Djibouti Dominica Dominican Republic East Timor Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Ethiopia Falkland Islands Faroe Islands Fiji Islands Finland French Guiana French Polynesia French Southern Terr. Gabon Gambia Georgia
RE: [PHP-DB] mySQL Query and blank fields
I'd like to do it in mySQL, I think it will be done much quicker since it a large database. The type of the field is allready varchar. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 16:08 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields First, I wouldn't use length(), I'd use REGEXP: SELECT * FROM foo_table WHERE fieldname REGEXP '..+' It's quicker. As far as the second question, do you wish to do it in PHP or MySQL? Does the value in MySQL require other computations (so, it must remain numeric) or can it be a CHAR string? -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:04 AM To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Thanks a lot! I quite didn't know what to look for in the manual. I actually have another question: If I want to update several fields, add a number to the end of the fields value, how do I do that? I have field with value '9876' and if I do "...field=field+'5'..." the value turns into '9881' not '98765' as I expected. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 15:56 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Change that to: SELECT * FROM foo_table WHERE length(bar_field)>1; -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:01 AM To: Niklas Lampén; Php-DB Subject: Re: [PHP-DB] mySQL Query and blank fields On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] mySQL Query and blank fields
First, I wouldn't use length(), I'd use REGEXP: SELECT * FROM foo_table WHERE fieldname REGEXP '..+' It's quicker. As far as the second question, do you wish to do it in PHP or MySQL? Does the value in MySQL require other computations (so, it must remain numeric) or can it be a CHAR string? -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:04 AM To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Thanks a lot! I quite didn't know what to look for in the manual. I actually have another question: If I want to update several fields, add a number to the end of the fields value, how do I do that? I have field with value '9876' and if I do "...field=field+'5'..." the value turns into '9881' not '98765' as I expected. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 15:56 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Change that to: SELECT * FROM foo_table WHERE length(bar_field)>1; -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:01 AM To: Niklas Lampén; Php-DB Subject: Re: [PHP-DB] mySQL Query and blank fields On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mySQL Query and blank fields
>I have field with value '9876' and if I do "...field=field+'5'..." the >value turns into '9881' not '98765' as I expected. make your field type "var char" - Original Message - From: "Niklas Lampén" <[EMAIL PROTECTED]> To: "Php-DB" <[EMAIL PROTECTED]> Sent: Thursday, October 25, 2001 3:03 PM Subject: RE: [PHP-DB] mySQL Query and blank fields Thanks a lot! I quite didn't know what to look for in the manual. I actually have another question: If I want to update several fields, add a number to the end of the fields value, how do I do that? I have field with value '9876' and if I do "...field=field+'5'..." the value turns into '9881' not '98765' as I expected. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 15:56 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Change that to: SELECT * FROM foo_table WHERE length(bar_field)>1; -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:01 AM To: Niklas Lampén; Php-DB Subject: Re: [PHP-DB] mySQL Query and blank fields On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] mySQL Query and blank fields
Thanks a lot! I quite didn't know what to look for in the manual. I actually have another question: If I want to update several fields, add a number to the end of the fields value, how do I do that? I have field with value '9876' and if I do "...field=field+'5'..." the value turns into '9881' not '98765' as I expected. Niklas -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 25. lokakuuta 2001 15:56 To: Php-DB Subject: RE: [PHP-DB] mySQL Query and blank fields Change that to: SELECT * FROM foo_table WHERE length(bar_field)>1; -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:01 AM To: Niklas Lampén; Php-DB Subject: Re: [PHP-DB] mySQL Query and blank fields On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] mySQL Query and blank fields
Change that to: SELECT * FROM foo_table WHERE length(bar_field)>1; -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:01 AM To: Niklas Lampén; Php-DB Subject: Re: [PHP-DB] mySQL Query and blank fields On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mySQL Query and blank fields
On Thursday 25 October 2001 13:16, Niklas Lampén wrote: > How can I query for specified fields that has to contain atleast 2 > charters? SELECT * FROM foo_table WHERE length(bar_field)>=1; Arpi > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] executing system commands
Does your web-host permit you to execute system commands? For system security, most will not. -Original Message- From: Ric Manalac [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 5:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] executing system commands hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = "mkdir /home/httpd/html/miroku/downloads/$directory"; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] mySQL Query and blank fields
REGEXP '..+' -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 6:17 AM To: Php-DB Subject: [PHP-DB] mySQL Query and blank fields How can I query for specified fields that has to contain atleast 2 charters? Example: Field AAA contains '' (NULL) => No match Field BBB contains ' ' (one charter) => No match Field CCC contains 'ab' => Match Field DDD contains 'abcdefg' => Match Niklas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP & Paradox.
Hi, Yesterday I posted a question about PHP and Paradox. I'd apreciate any comment, sugestion, link... anything. I'm a linux user trying to hadle with a W2k and ODBC. I found nothing related to this problem in the net. Here is the error message: Warning: SQL error: [Microsoft][Driver ODBC para Paradox] Não foi possível abrir PARADOX.NET., SQL state S1000 in SQLConnect in c:\inetpub\wwwroot\odbc.php on line 2 Please, I'm desperate. Thank's. Bruno Gimenes Pereti. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mySQL Query and blank fields
Assuming you're using MySQL - 35 seconds is all it took to find: http://www.mysql.com/doc/P/a/Pattern_matching.html Good luck! Russ. On Thu, 25 Oct 2001 14:16:40 +0300 =?iso-8859-1?Q?Niklas_Lamp=E9n?= <[EMAIL PROTECTED]> wrote: > How can I query for specified fields that has to contain atleast 2 > charters? > > Example: > Field AAA contains '' (NULL) => No match > Field BBB contains ' ' (one charter) => No match > Field CCC contains 'ab' => Match > Field DDD contains 'abcdefg' => Match > > > Niklas #---# "Believe nothing - consider everything" Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w: www.apu.ac.uk/webteam www.theruss.com #---# -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] mySQL Query and blank fields
How can I query for specified fields that has to contain atleast 2 charters? Example: Field AAA contains '' (NULL) => No match Field BBB contains ' ' (one charter) => No match Field CCC contains 'ab' => Match Field DDD contains 'abcdefg' => Match Niklas
[PHP-DB] Turning on/off HTML output in Postgres
Hi, Is there a way of specifying via PHP's PostgreSQL functions whether the output is in HTML or not? I.e. the same as saying '\H' when using psql? Obviously I could write this functionality using a PHP function but since it's build into Postgres just wondered if anyone knew how to do it? Thanks Alistair -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] executing system commands
hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = "mkdir /home/httpd/html/miroku/downloads/$directory"; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]