Re: [PHP-DB] Re: how to notify admin by e-mail only once if mysq
On Sunday 14 April 2002 03:24 pm, Ruprecht Helms wrote: Hi Lisi, Pardon my ignorance, but what's webmin? not a problem. Webmin is a webbased administrationtool for different things to administrate. It begins from useraccounting and ends by administration squid, apache, postfix/qmail, samba, and others. Regards, Ruprecht -- E-Mail: Ruprecht Helms [EMAIL PROTECTED] Date: 14-Apr-02 Time: 23:21:26 to be informed - http://www.rheyn.de - This message was sent by XFMail -- On a Linux system you can find Webmin by typing http://localhost:1 Some systems require a secure connection to Webmin, in that case you'd type https://localhost:1 HTH -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] timestamp iin MySQL not compatible to the one in PHP???
On Tuesday 05 March 2002 05:11 pm, Andy wrote: So what is the proper function in PHP to convert the MySQL timestamp into a proper format like Sonday, Apr. 20th 2002? ?php echo date(D. M. d, Y) ? Thanx, Andy Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... On Wednesday 06 March 2002 04:31, Andy wrote: Hi there, I am playing around with the timestamp functions. I created a timestamp with mysql ( the row is timestamp) and do reformat this thing after selecting with php in the folowíng way: $date_posted[$i] = strftime(%A, %d-%m-%Y %R, $date_posted[$i]); This always returns Tuesday, 19-01-2038 but the mysql timestamp says: 20020305211704 They return the time in different formats. Read the MySQL manual then read the PHP manual (or vice-versa). The MySQL timestamp is human readable. So in your example above: 20020305211704 == 2002-03-05 21:17:04 time() in PHP is the number of seconds since the Unix Epoch. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* But, officer, he's not drunk, I just saw his fingers twitch! */ -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] any php/Linux gurus out there?
On Monday 04 March 2002 05:54 pm, Pedro M. S. Oliveira wrote: you could complile the hole program instead of the rpm, just read README.install from the php source tar file. or you can install the other rpms that are lacking. or even so, not such a good ideia, but you can force the installationg using the command rpm -i --nodeps php or rpm -U --nodeps phpxxx - Original Message - From: Peter Lovatt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 04, 2002 11:52 PM Subject: [PHP-DB] any php/Linux gurus out there? Hi I am running the security upgrade and am getting the following error when I run the RPM The install is RH 7.0 and was pre-installed. I had assumed that the RPMs from Redhat would match the pre installed version, as it was standard. I am a humble programmer (and part time sys admin!), rather than a Linux/RH guru, so would appreciate some advice. What is the best way to deal with this ? error: failed dependencies: libcrypto.so.1 is needed by php-4.0.6-9.7.0 libmm.so.11 is needed by php-4.0.6-9.7.0 libssl.so.1 is needed by php-4.0.6-9.7.0 libcrypto.so.1 is needed by php-imap-4.0.6-9.7.0 Go to www.rpmfind.net and search for the dependent library's . Use rpm -ivh to install along side any others of a different release version and you should make out OK. --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- sql table -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Retrieving a date.
On Sunday 03 March 2002 02:48 am, DL Neil wrote: Ken, Check out DAYOFMONTH() and MONTH() and a wealth of other useful date functions. RTFM: 6.3.4 Date and Time Functions There's a few interesting items here OK, Thanks for the pointer. Go for it... The answer to your question about AUTO_INCREMENT 'reset' can be found at 6.5.3 CREATE TABLE Syntax under table_options. EH? It says what?? I'm so green that this makes NO sense at all. Regards,table_options: TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM } or AUTO_INCREMENT = # You asked: Off Topic, I saw something about resetting the auto-increment counter, but now I can't find reference to it. Can some kind soul enlighten me??? Sorry to overwhelm you with jargon - it can be difficult to assess a person's capabilities over the email. So by way of a general answer may I point you at the MySQL and PHP web site home pages, and from there to their links to tutorial books and web sites. These will help you with concepts and examples. The reference to 6.5.3 CREATE TABLE Syntax is in the electronic manual at http://www.mysql.com/doc/C/R/CREATE_TABLE.html. The CREATE TABLE command enables you to (re-)build a table by defining its 'schema' (definitions, rules and/or constraints). The very next section of the manual, 6.5.4 ALTER TABLE Syntax deals with making changes to a table's structure. If you are starting from scratch the former applies. If amending an existing table, then the latter is of more interest. Logically enough both follow much the same rules in terms of what you can/can't do. Reading the CREATE TABLE command 'template', we see: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [select_statement] table options is therefore something that may be included almost at the end of the command. may is indicated by the square brackets = optional. So a 'bare' command would include the words CREATE and TABLE, followed by a table name, and then defining one or more fields within parentheses. eg CREATE TABLE Cinfo ( Cid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Fname TEXT) The contents of the parentheses - a list of fields and their definitions, are templated by the two lists: create_definition and type. Once the fields are defined (and the parentheses closed) you MAY then decide to add further descriptions of the table. These are defined in the table_options definitions, and include an additional specification of interest to you: AUTO_INCREMENT = # If you add this clause to the above and replace the # with a suitable integer, you can define the starting sequence number to be used in the ID column, eg: CREATE TABLE Cinfo ( Cid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Fname TEXT) AUTO_INCREMENT = 1001; Hope that's enough to get you re-started. If you plug AUTO_INCREMENT into the electronic manual's search facility you find a ton of stuff showing you how to use such columns/series - and a few warnings. Ok? =dn Great, that explains better than most of the tutorials I've read. It is unfortunate that most if not all reference documentation expect the reader to have a college degree just on their subject in order to understand wot in 'ell they're saying. I've done pretty well in figuring out many thing on my own but sometimes ya just need an expert to chip in and make yer day. My thanks, -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Retrieving date, partially solved
I have the thing returning the date as long as the date format is m/d in the table with a seperate year column. Here's the table: mysql select * from Cinfo; +-++--+---+---+ | Cid | Fname | Lname| Bday | Byear | +-++--+---+---+ | 1 | Lars | Larsen | 03/02 | 1960 | | 2 | Larry | Loophole | 03/02 | 1950 | | 3 | Fuzzy | Wimp | 03/02 | 1990 | | 4 | Willy | Warp | 03/03 | 1960 | | 5 | Harry | Toes | 03/03 | 1998 | | 6 | Jiminy | Cricket | 03/04 | 1889 | +-++--+---+---+ 6 rows in set (0.00 sec) Here's the code, I would welcome comments or improvements. $db = mysql_connect(localhost, root); $Date = date(m/d); mysql_select_db(customers,$db); $result = mysql_query(SELECT * FROM Cinfo WHERE Bday = '$Date'); The result is sent to a table and to my surprise actually works... -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Retrieving a date.
On Saturday 02 March 2002 16:13, DL Neil wrote: Ken, Check out DAYOFMONTH() and MONTH() and a wealth of other useful date functions. RTFM: 6.3.4 Date and Time Functions There's a few interesting items here OK, Thanks for the pointer. The answer to your question about AUTO_INCREMENT 'reset' can be found at 6.5.3 CREATE TABLE Syntax under table_options. EH? It says what?? I'm so green that this makes NO sense at all. Regards,table_options: TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM } or AUTO_INCREMENT = # =dn -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Retrieving a date.
I have a test table with the ususal customer information in it along with a field for the date of birth. I'm trying to return records of any customers whose birthdates are the same day and month as the current date. Here's the query result: mysql SELECT * FROM Cinfo WHERE BirthDate = date('m d'); Empty set (0.00 sec) Here's what is returned with a global query: mysql select * from Cinfo; +---+--+---+-+---++--+--+--+++ | FirstName | LastName | Address | City| State | Zip| HomePhone| WorkPhone| CellPhone| BirthDate | id | +---+--+---+-+---++--+--+--+++ | Joe | Blow | 1200 High St. #12 | St.Looy | UT| 844110 | 801-111-2299 | 801-111-3456 | 801-213-8956 | 1959-03-01 | 1 | | | | | | || | | || 2 | | | | | | || | | || 3 | | | | | | || | | || 4 | +---+--+---+-+---++--+--+--+++ 4 rows in set (0.00 sec) I have a feeling it's the date format in the table. I tried making it a date field but just got the current date. What am I doing wrong? Off Topic, I saw something about resetting the auto-increment counter, but now I can't find reference to it. Can some kind soul enlighten me??? -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Resource link errors
Thanks Rick, Now it works. On Thursday 07 February 2002 03:04 pm, Rick Emery wrote: The following means you have not opened a link to your database. Concerntrate your efforts there. Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/html/list.php3 on line 26 -Original Message- From: Ken Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Resource link errors Hello all, I'm very new to php and have been beating my head on the wall over this for 2 days. I've searched through the php documentation but I guess I either don't know where or what to look for or don't understand what I'm seeing. I think this has to be an array but the original doesn't seem to think so.(see below) I've tried ($myrow = mysql_fetch_array($result)) and still get the same errors. The original that I used as an example works OK showing the results of Name, Position. They didn't include a data cell for $myrow[3] ... = THIS WORKS: ?php $title = Welcome to the Web-Site of; /*I commented this out and finaly removed it cuz I don't want the title echoed in the final page.*/ include(header.inc); $result = mysql_query(SELECT * FROM employees,$db); echo table border=1\n; echo trtdName/tdtdPosition/tr\n; while ($myrow = mysql_fetch_row($result)) { echo(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; include(footer.inc); ? === What I am trying to do is to return the results of the query into a table with these items: +---+-+--+-+-++ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-++ | id| tinyint(4) | | PRI | NULL| auto_increment | | year | int(4) | YES | | NULL|| | make | varchar(20) | YES | | NULL|| | model | varchar(20) | YES | | NULL|| | engine| varchar(20) | YES | | NULL|| | fuel | varchar(8) | YES | | NULL|| | trans | varchar(10) | YES | | NULL|| | condition | varchar(20) | YES | | NULL|| | price | varchar(10) | YES | | 0 || | location | varchar(20) | YES | | NULL|| +---+-+--+-+-++ These are the errors that show up when I run the page in the browser. The database is local and I'm on Linux-Mandrake 8.1 using Apache web server. I can get the results I want from the command line, that is I can make queries and get the proper info returned. what have I done to cause it not to work? Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/html/list.php3 on line 26 Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/list.php3 on line 32 THIS DOESN'T: I get the table and the item name e.g. Year, Make etc. Once I get the 3 cells returning the proper info, I want to add the rest of the cells needed to display all the info in the web page. I don't think it should be a problem, comments on this? ?php include(header.inc); //(Line 26 below, everything above ?php is plain html.) $result = mysql_query(SELECT * FROM autos,$db); echo table border=1\n; echo trtdYear/tdtdMake/tdtdModel/td/tr\n; //(Line 32 below) while ($myrow = mysql_fetch_row($result)) { //What does the '%s' mean? I read it someplace in the tutorial //but can't find it now. printf(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; include(footer.inc); ? -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Resource link errors
Hello all, I'm very new to php and have been beating my head on the wall over this for 2 days. I've searched through the php documentation but I guess I either don't know where or what to look for or don't understand what I'm seeing. I think this has to be an array but the original doesn't seem to think so.(see below) I've tried ($myrow = mysql_fetch_array($result)) and still get the same errors. The original that I used as an example works OK showing the results of Name, Position. They didn't include a data cell for $myrow[3] ... = THIS WORKS: ?php $title = Welcome to the Web-Site of; /*I commented this out and finaly removed it cuz I don't want the title echoed in the final page.*/ include(header.inc); $result = mysql_query(SELECT * FROM employees,$db); echo table border=1\n; echo trtdName/tdtdPosition/tr\n; while ($myrow = mysql_fetch_row($result)) { echo(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; include(footer.inc); ? === What I am trying to do is to return the results of the query into a table with these items: +---+-+--+-+-++ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-++ | id| tinyint(4) | | PRI | NULL| auto_increment | | year | int(4) | YES | | NULL|| | make | varchar(20) | YES | | NULL|| | model | varchar(20) | YES | | NULL|| | engine| varchar(20) | YES | | NULL|| | fuel | varchar(8) | YES | | NULL|| | trans | varchar(10) | YES | | NULL|| | condition | varchar(20) | YES | | NULL|| | price | varchar(10) | YES | | 0 || | location | varchar(20) | YES | | NULL|| +---+-+--+-+-++ These are the errors that show up when I run the page in the browser. The database is local and I'm on Linux-Mandrake 8.1 using Apache web server. I can get the results I want from the command line, that is I can make queries and get the proper info returned. what have I done to cause it not to work? Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/html/list.php3 on line 26 Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/list.php3 on line 32 THIS DOESN'T: I get the table and the item name e.g. Year, Make etc. Once I get the 3 cells returning the proper info, I want to add the rest of the cells needed to display all the info in the web page. I don't think it should be a problem, comments on this? ?php include(header.inc); //(Line 26 below, everything above ?php is plain html.) $result = mysql_query(SELECT * FROM autos,$db); echo table border=1\n; echo trtdYear/tdtdMake/tdtdModel/td/tr\n; //(Line 32 below) while ($myrow = mysql_fetch_row($result)) { //What does the '%s' mean? I read it someplace in the tutorial //but can't find it now. printf(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; include(footer.inc); ? -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL
I'm just learning MySQL and PHP so this fresh from my last snoop through the documentation, hope it will help. From the command line you can make a global query like - SELECT * FROM pets; and all the info stored in the table will be shown. To update a record use the update query: UPDATE pet SET birth = 1998-04-15 WHERE name = Kitty; This changes only one record at a time. I hope this will also work from a shell account on a web hosting service it should.. As mentioned earlier phpMyAdmin is very nice and makes life a lot more fun G... BUT not all hosting services have phpMyAdmin installed so ya gotta do it the hard way.. On Monday 04 February 2002 09:34 am, you wrote: Go download PHPMyAdmin. - Original Message - From: Morten Nielsen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 04, 2002 8:34 AM Subject: [PHP-DB] MySQL Hi, Is there an easy way to see the data in a table? I made a table that contains information about people. How do I see/change the contenst of the table? Thanks, Morten -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL connect
On Monday 04 February 2002 10:54 am, you wrote: Hi all, Ok I am learning this on my own but I could use some help. I have started these two pages test.php and config.php here is the code: test.php ? // include the database configuration include config.php; In looking at my include page I noticed there were parenthisis around the include statement, maybe this is your problem. include(header.inc); // connect to database mysql_connect($db[host],$db[user],$db[password],$db[database]) or die (sorry not successful); // if no connect then exit exit; // if connect successful echo (you have connected); ? config.php ? // database config $db[host] = localhost; $db[user] = me; $db[password] = mypassword; $db[database] = mydb; ? All I'm trying to do is successfully connect to the database but it returns sorry not successful. What have I done wrong? I have gone straight from the php pocket reference manual and it doesn't work. Would someone please explain what has happened? Thanks J Leonard -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php